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 a page to an image with zoom factor?

Thread ID:





125734 Sep 7,2016 07:27 PM UTC Sep 8,2016 12:40 PM UTC WPF 1
Tags: PdfViewer
Asked On September 7, 2016 07:27 PM UTC


I been given the below code to export the page as an image

Bitmap image = pdf.ExportAsImage(0, new SizeF(s.Width * zoomfactor, s.Height * zoomfactor), true); 

The function is:

public Bitmap ExportAsImage(int pageIndex, SizeF customSize, bool keepAspectRatio);

What is the unit of the customSize? it is pixels or points?

Thanks in advance


"At present we do not support exporting pages of the PDF document as images with custom zoom factor using PDF viewer WPF. As a workaround please use the ExportAsImage method in PdfLoadedDocument by providing custom size for an image to export. 
Please find the code snippet for your reference. 
PdfLoadedDocument pdf = new PdfLoadedDocument("example.pdf"); 
SizeF s = pdf.Pages[0].Size; 
Bitmap image = pdf.ExportAsImage(0, new SizeF(s.Width * zoomfactor, s.Height * zoomfactor), true); 
We have also provided a sample below which exports the page as image with custom size for your reference. 

Pavithra Dwarakanathan [Syncfusion]
Replied On September 8, 2016 12:40 PM UTC

Hi Tomer, 

The unit of customSize is Pixels. 
Please let us know if you need further assistance. 

Pavithra D. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to 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