Getting Started

Adding reference to PdfViewerControl and dependent assemblies

Refer to the Control Dependencies section to get the list of assemblies.

Installing NuGet packages

Adding reference to Syncfusion assemblies through NuGet packages is illustrated in the NuGet Packages section.

NOTE

Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to this link to know about registering Syncfusion license key in your Windows Forms application to use our components.

Adding from the installed location

The PdfViewerControl and dependent assemblies can be found from the below location in your machine.

system drive:\Program Files (x86)\Syncfusion\Essential Studio\17.3.0.9\precompiledassemblies\17.3.0.9\

Adding PdfViewerControl to an Application

Adding in designer

1) Open your form in the designer. Add the Syncfusion controls to your .NET toolbox in Visual Studio if you haven’t done so already (the install would have automatically done this unless you selected not to complete toolbox integration during installation).

Windows forms pdfviewer drag and drop from toolbox

2) Drag the PdfViewerControl from the toolbox onto the form.

Appearance and behavior related aspects of the PdfViewerControl can be controlled by setting the appropriate properties through the properties grid.

Windows forms pdfviewer displays properties window of control

3) This will add the instance ‘pdfViewerControl1’ to the Designer cs file. The PDF can be loaded in the Form cs file using the Load method.

//Loading the document in the PdfViewerControl
pdfViewerControl1.Load("Sample.pdf");
'Loading the document in the PdfViewerControl
pdfViewerControl1.Load("Sample.pdf")

Adding manually in code

1) Add Syncfusion.Windows.Forms.PdfViewer namespace.

using Syncfusion.Windows.Forms.PdfViewer;
Imports Syncfusion.Windows.Forms.PdfViewer

2) Create PdfViewerControl instance and load the PDF

//Initializing the PdfViewerControl
PdfViewerControl pdfViewerControl1 = new PdfViewerControl();

//Loading the document in the PdfViewerControl
pdfViewerControl1.Load("Sample.pdf");

//Add PdfViewerControl to the Form
Controls.Add(pdfViewerControl1);
'Initializing the PdfViewerControl
Dim pdfViewerControl1 As PdfViewerControl = New PdfViewerControl()

'Loading the document in the PdfViewerControl
pdfViewerControl1.Load("Sample.pdf")

'Add PdfViewerControl to the Form
Controls.Add(pdfViewerControl1)

Refer to Viewing PDF files for more information.

Appearance and Structure of the Control

The following screenshot depicts different sections of the PdfViewerControl.

Windows forms pdfviewer displays different section of control

Toolbar

Windows forms pdfviewer displays the toolbar

  1. Open file
  2. Bookmark
  3. Save document
  4. Print PDF
  5. Go to first page
  6. Go to previous page
  7. Page indicator
  8. Go to next page
  9. Go to last page
  10. Preset magnification
  11. Decrease magnification
  12. Increase magnification
  13. Fill window
  14. Fit page to window