Simple Example

Creating an application that includes a PdfViewer control is straightforward. The instructions below illustrate just how easy it is integrating Viewer into a simple Visual Studio 2010, C# Windows Form Application.

Installation of the PdfViewer Control

Note that you must install the latest DynamicPDF Viewer version for .NET evaluation. The easiest way to install it is through the Nuget package manager in visual studio. For more information, refer to ceTe.DynamicPDF.Viewer.NET on NuGet. Alternatively, you can download and install the Assemblies as a Zip file directly from the DynamicPDF website (https://www.dynamicpdf.com/View-PDF-.NET.aspx).

Using the PdfViewer Control

Perform the following steps to create a simple application using the DyamicPDF Viewer control.

  1. Create or open a C# Windows Form application in Visual Studio.

  2. Open the Toolbox (Ctrl + Alt + X).

  3. From the Toolbox (in the “General” section), add the “PdfViewer” control to the Windows form.

  4. Select the control and set its Name property to “pdfViewer.”

  5. Re-size, position, and set any additional properties as needed.

  6. Double-click on any empty form area and add the following line of code to the Form_Load method: pdfViewer.Open(pdfFilePath); (ensure the file path is to a valid PDF document).

  7. Run the application to view the PDF specified in step 6 that appears on the form.

NOTE: These instructions should work with older Visual Studio versions, although you might notice slight differences.

More Examples

For more complete examples, refer to the GitHub examples project.

In this topic