This tutorial will show how to get started with XFINIUM.PDF Viewer in Windows Forms applications.
1. Add XFINIUM.PDF Viewer to Visual Studio toolbox.
2. Open your form in Visual Studio Designer.
3. Drag a PdfDocumentView control from the toolbox onto the form and name the control ‘documentView‘. A reference to xfinium.pdf.view.win.dll will be added automatically to your project.
4. Add references to xfinium.pdf.win.dll and xfinium.pdf.render.dll to your project.
5. In your form’s Load event create a PdfVisualDocument object, set the documentView’s Document property with the PdfVisualDocument object and load a file in the document.
C#
Xfinium.Pdf.View.PdfVisualDocument document = new Xfinium.Pdf.View.PdfVisualDocument(); documentView.Document = document; FileStream pdfStream = File.OpenRead("D:\Doc\xfinium.pdf"); document.Load(pdfStream); pdfStream.Close();
VB
Dim document As New Xfinium.Pdf.View.PdfVisualDocument() documentView.Document = document Dim pdfStream As FileStream = File.OpenRead("D:Docxfinium.pdf") document.Load(pdfStream) pdfStream.Close()
6. Run the application.
Hi,
Is it possible to remove scroll bars and pages information from a PdfDocumentView ?
Thanks in advance.
It is not possible to remove the scroll bars and page number from the PdfDocumentView control. The PdfCoreView control is the actual control that displays the pages. This control does not have any UI except the PDF pages. You can use this control if you don’t want scroll bars. This control is also embedded in the PdfDocumentView.