Category / Section
How to use Pdfium rendering engine in WPF PDFViewer?
2 mins read
From 16.1.0.24 and higher versions of Essential Studio release, the PDF viewer control provides a robust rendering of PDF document using PDFium rendering engine. Use the following steps to use Pdfium rendering in Syncfusion WPF PDF viewer.
- Copy the Pdfium assembly’s folder to a local folder from the installation path. The folder name must be “Pdfium”.
The Pdfium assemblies will be available in
{$SystemDrive}:\Program Files (x86)\Syncfusion\Essential Studio\{Essential Studio version}\Pdfium
Note:
The Pdfium folder contains two folders such as X86 and X64, and both folders contain pdfium.dll assembly for the respective architecture. The Syncfusion PDF viewer is designed to detect the architecture of the target machine where it is deployed and will pick corresponding pdfium.dll to use it.
- The ReferencePath property of the PDF viewer should be set to locate the “Pdfium” folder.
The following code snippet illustrates this.
PdfViewerControl viewer = new PdfViewerControl(); //Set the reference path of Pdfium assemblies viewer.ReferencePath = @"D:\Reference path"; //Set the rendering engine of PDF viewer to Pdfium viewer.RenderingEngine =PdfRenderingEngine.Pdfium; //Load the PDF document in PDF viewer. viewer.Load("Sample.pdf");