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

Generate image of first page.

On my winRT i have some tiles that represent files.
If the file is a image the tile background uses that image.

I would like to know if there is a way to extract a image that is the first page of the pdf file so i can use it as a preview on the tile.

something like this.



6 Replies

BS Balasubramanian Sundararajan Syncfusion Team August 13, 2015 04:46 PM UTC

Hi Ric,

 

Thank you for using syncfusion product.

 

Yes we can export the images using SfPdfViewer Control. We have created the sample which exports first page of the PDF document as the image by using the following code snippet:


pdfViewerControl1.LoadDocument(ldoc);                    

Image page = pdfViewerControl1.GetPage(0);

Also please find the sample from the below link,

http://www.syncfusion.com/downloads/support/forum/119907/ze/PDFViewerWintRT_2013-1492323365

In this sample, the first five pages of the document will export as images if we clicked the Exported first page.

 

Please let us know if you need further assistance.

 

Thanks,

Balasubramanian



RS Ric Silva August 13, 2015 05:32 PM UTC

so if i have 15 pdf files , in order to create the 15 tiles with the first page images, i have to load the 15 pdf files to the PdfViewer?


RS Ric Silva August 13, 2015 09:17 PM UTC

ok i managed to adapt to my project :)

is there any change that works with doc files too using SfRichTextBoxAdv ?


NS Narendran Srinivasan Syncfusion Team August 14, 2015 11:22 AM UTC

Hi Ric,

Thank you for your update,

Regarding “SfRichTextBoxAdv”
Using SfRichTextBoxAdv control you can retrieve the pages as bitmap image. For Your reference we have prepared a sample to illustrate your requirement to get first page in SfRichTextBoxAdv control as bitmap image. Please do find the sample from below link.

Sample link:
Sample

Regarding “PdfViewer”

Yes, In PdfViewer Control we can load only one document at a time. So if one wants to get the first page of the 15 documents they need to load all those documents separately in PdfViewer Control.


Please let us know if you have any other questions.

Regards,
Narendran




RS Ric Silva August 14, 2015 02:01 PM UTC

im getting 
Error 1 'Syncfusion.UI.Xaml.RichTextBoxAdv.SfRichTextBoxAdv' does not contain a definition for 'GetPageAsImageAsync' and no extension method 'GetPageAsImageAsync' accepting a first argument of type 'Syncfusion.UI.Xaml.RichTextBoxAdv.SfRichTextBoxAdv' could be found (are you missing a using directive or an assembly reference?)

using syncfusion winrt 13.1.0.21



NS Narendran Srinivasan Syncfusion Team August 17, 2015 08:50 AM UTC

Hi Ric,

Thank you for your update,

The support for retrieving page in SfRichTextBoxAdv control as bitmap image is not available with Essential Studio version 13.1.0.21. We have added this support and included in our Essential Studio version 13.2.0.29 service pack 1 and is available for download under the following link.


http://www.syncfusion.com/forums/119866/essential-studio-2015-volume-2-service-pack-release-v13-2-0-34-available-for-download

Please let us know if you have any other questions.

Regards,
Narendran


Loader.
Live Chat Icon For mobile
Up arrow icon