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.
You can also manually install the control by downloading and installing the assemblies as a Zip file directly from the DynamicPDF website (https://www.dynamicpdf.com/View-PDF-.NET.aspx). 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.
Create or open a C# Windows Form application in Visual Studio.
Open the Toolbox (Ctrl + Alt + X).
From the Toolbox (in the General section), add the PdfViewer control to the Windows form.
Select the control and set its Name property to
Re-size, position, and set any additional properties as needed.
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).
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.
For more complete examples, refer to the GitHub examples project.