Using PDF-viewer in Windows-Form

Last post 09-04-2009, 6:06 AM by Eco. 2 replies.
Sort Posts: Previous Next
  •  09-03-2009, 3:45 AM 196493

    Using PDF-viewer in Windows-Form .NET

    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
     
  •  09-04-2009, 5:41 AM 196727 in reply to 196493

    Re: Using PDF-viewer in Windows-Form

    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,


    Shahzad Latif - [Follow me on Twitter!]
    Support Developer/Developer Evangelist
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  09-04-2009, 6:06 AM 196733 in reply to 196727

    Re: Using PDF-viewer in Windows-Form

    That helps, thank you.
     
View as RSS news feed in XML