Getting the first page of pdf file using PDFViewer

Hello,

Im working with Visual Studio 2008, .NET 3.5 SP1 and aspose 5.0.01.

I’m trying to:

get and display as an image the first page of a pdf file as soon as it is possible. And then, when the first page is loaded and displayed I want to load the rest of the pages in a background thread.
However when I do (in simplified code):

Aspose.Pdf.Kit.PdfViewer lViewer;
lViewer = new PdfViewer();
lViewer.OpenPdfFile(filePath);

Bitmap bmp = lViewer.DecodePage(1); //This takes around 5-10s
Bitmap bmp2 = lViewer.DecodePage(2); // This is much quicker
Bitmap bmp3 = lViewer.DecodePage(3);// This is much quicker

I have to wait for the first page for quite a long time. Is it possible within PdfViewer, or PdfConverter do the thing? I mean: Taking the first page really quickly, and then load other pages in the background thread?

Regards,

Janis

Hi Janis,

Thank you very much for considering Aspose.

First of all, I would like to share with you that while converting PDF pages to Bitmaps using PdfViewer, the conversion takes 2 seconds per page on average. However, this time might be higher depending upon the contents of the PDF pages i.e. graphics, complex drawing commands etc.

Secondly, you can also convert the PDF pages to images using PdfConverter class. Please try this class at your end and see if it helps in your scenario.

Lastly, if you’re not satisfied with the results from PdfViewer and PdfConverter classes then please share the input PDF file with us, so we could test it and then try to improve the performance.

We’re sorry for the inconvenience and looking forward to help you out.
Regards,