How to export the PDF pages to images in ASP.NET MVC (Classic)?
We can export the pages of the PDF document to images using the ExportAsImage functionality in PdfViewerControl as in the below code snippet.
//Creating new instance for PdfViewerControl
PdfViewerControl viewerControl = new PdfViewerControl();
//Loading the PDF document from the physical path
//Exporting PDF Document to image as Bitmap
Bitmap image = viewerControl.ExportAsImage(0,viewerControl.PageCount-1);
for (int i = 0; i < viewerControl.PageCount; i++)
//Save the Document into local disk
image[i].Save(”OutputImage_" + i + ".png",ImageFormat.Png);
Run the sample and click Export button. The exported images are saved in Output folder.
I hope you enjoyed learning about how to export the PDF pages to images in ASP.NET MVC PDF.
You can refer to our ASP.NET MVC PDF Viewer feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our ASP.NET MVC PDF Viewer Example to understand how to create and manipulate data.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!