Using PDF-viewer in Windows-Form

Hello Aspose-Team,

i’ve downloaded the latest version of Aspose.Pdf.Kit and now I’m wondering how i can implement the class into a windows-form, as the class does not seem to be derivated from System.Windows.Forms.Control.

Perhaps you can give me a little example how i can use the PDFViewer-class as an integrated pdf-viewer in a .NET-application.

Thanks in advance for your help.

Regards,
Eco

Hi Daniel,

Thank you very much for considering Aspose.

In order to view a PDF file, using PdfViewer, in your windows or web forms application, you’ll have to convert the pages into images using either DecodePage or DecodeAllPages method. After that you’ll be able to show this image using any image control. You can find a sample below which shows you how to decode a page into image.



PdfViewer v = new PdfViewer();

v.OpenPdfFile(“file1.pdf”);


System.Drawing.Bitmap b = v.DecodePage(1);


Now, you can assign this image to any image control.

I hope this helps. If you have any further questions, please do let us know.
Regards,

That helps, thank you.