We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to export the PDF pages to images in ASP.NET MVC (Classic)?

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.

HomeController.cs

//Creating new instance for PdfViewerControl

 

PdfViewerControl viewerControl = new PdfViewerControl();

//Loading the PDF document from the physical path

 

viewerControl.LoadDocument(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);

}

 

Sample:

http://www.syncfusion.com/downloads/support/directtrac/general/ze/ExportAsImage-331838386

Run the sample and click Export button. The exported images are saved in Output folder.

 

Article ID: Published Date: Last Revised Date: Platform: Control:
6139 01/27/2016 01/27/2016 ASP.NET MVC (Classic) PdfViewer
Did you find this information helpful?
Comments
spirou Jun 28, 2018

gfzg

Reply
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.