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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Platform: ASP.NET MVC (Classic) |
Control: PdfViewer |
Published Date: January 27, 2016 |
Last Revised Date: January 27, 2016

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.

 

ADD COMMENT
You must log in to leave a comment
Comments
spirou
Jun 28, 2018

gfzg

Reply

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon