Simple Example

Creating an application that includes the DynamicPDF PdfViewer control is straightforward. The instructions below illustrate integrating PdfViewer into a Visual Studio 2010, C# Windows Form application.

Installation of the PdfViewer Control

The easiest way to reference and deploy DynamicPDF PdfViewer in your project is by installing the NuGet package from directly within Visual Studio's Package Manager. Alternatively, you can follow the instructions here to deploy the control manually.

We recommend installing using the NuGet package, as this is the easiest and least error-prone installation method.

Regardless of method used, before installing, refer to Referencing the DynamicPDF Viewer for more complete installation instructions.

Install the latest DynamicPDF Viewer version for .NET evaluation. However, until licensing, any produced PDF will contain a watermark.

NuGet Package Manager

The easiest way to install the PdfViewer control is through the NuGet package manager in Visual Studio.

For more information on this package, refer to ceTe.DynamicPDF.Viewer.NET on NuGet.

Manual Installation

You can also manually install the control by downloading and installing the assemblies as a Zip file directly from the DynamicPDF website ( Refer to Referencing the DynamicPDF Viewer for manual installation instructions.

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.

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