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. Image for the cookie policy date
close icon

Rasterization of PDF files.

Hi,

I'm looking for a Xamarin component that can convert PDF documents / pages to raster images. Is this feature supported by your PDF or PdfViewer components? I need it for generation of preview images.

Best Regards,
Malin

1 Reply

NK Navaneetha Kannan Sudalai Muthu Syncfusion Team June 14, 2018 09:57 AM UTC

Hi Malin,  

At present, there is no support for converting PDF pages to raster images in both PDF and PdfViewer. We have already logged a feature request for the implementation of the support. The feature request can be tracked through our Feature Management System below.  


We will implement the feature in any of our upcoming releases. We usually have an interval of at least three months between releases. The implementation would also greatly depend on factors such as product design, code compatibility and complexity.  

However, PDF pages can be converted to images using native PDF rendering APIs in each platform.  

Android:  
The PdfRenderer class in the Android.Graphics.Pdf namespace can be used to read a PDF and render the pages as images.  


The Render method of the following Android API renders a PDF page onto a bitmap.  
 
 
 
iOS : 
In iOS the CGPdfDocument class can be used to read a PDF and the CGContext class can be used to render PDF pages.  



The DrawPDFPage method of CGContext draws a PDF page on the context of a drawable UI surface.  


 
UWP: 

In UWP the PdfDocument class can be used.  


The method PdfPage.RenderToStreamAsync method returns a stream from a PDF page. The stream can then be set to the Source of a bitmap.  




Best, 
Navaneetha Kannan

Loader.
Live Chat Icon For mobile
Up arrow icon