Articles in this section
Category / Section

How to use Pdfium rendering engine in Syncfusion PDF viewer for exporting the PDF documents into images

1 min 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. You can use Pdfium rendering to Export the PDF documents to images in the ASP.NET platform using the  Syncfusion.PdfViewer.Windows reference. The steps to use Pdfium rendering are as follows:

1. 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

 

C:\Users\sureshm\AppData\Local\Microsoft\Windows\INetCache\Content.Word\85A66790.png

The Pdfium folder contains two folders namely X86 and X64, and both contains pdfium.dll assembly for the respective architecture. The Syncfusion PDF viewer is designed to detect the architecture of the target machine in which it is deployed and pick corresponding pdfium.dll to use it.

C:\Users\sureshm\AppData\Local\Microsoft\Windows\INetCache\Content.Word\BF6074B2.png

2. Then, the ReferencePath property of the PDF viewer should be set to locate the “Pdfium” folder.The following code snippet illustrates how to export the PDF document into images using the PDFium.

string mappath = HttpContext.Current.Server.MapPath("~/Data/Sample.pdf");
PdfViewerControl viewer = new PdfViewerControl();
//Set the reference path of Pdfium assemblies            
viewer.ReferencePath = "D:/";
//Set the rendering engine of PDF viewer to Pdfium
viewer.RenderingEngine = PdfRenderingEngine.Pdfium;
//Load the PDF document 
viewer.Load(mappath);
string imagePath = HttpContext.Current.Server.MapPath("~/Images/");
Bitmap[] img = viewer.ExportAsImage(0, viewer.PageCount - 1);
for (int i = 0; i < img.Length; i++)
{
    img[i].Save(imagePath + "\\Image" + i + ".png");
}

 

Sample link:

https://www.syncfusion.com/downloads/support/directtrac/general/ze/PdfViewerWeb_pdfium1045004189

Here is the User Guide documentation of Syncfusion PDF Viewer in ASP.NET Web Forms.

Refer to this link to explore a rich set of PDF Viewer features.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please sign in to leave a comment
Access denied
Access denied