Referencing the DynamicPDF Viewer

The easiest way to reference and deploy DynamicPDF Viewer in your project is by installing the NuGet package directly within Visual Studio's Package Manager. Alternatively, you can follow the instructions to reference and deploy the assembly manually by downloading the zip file containing the necessary files from our website https://www.dynamicpdf.com/View-PDF-.NET.aspx.

Installing using the NuGet Package Manager is the easiest and least error-prone installation method.

Referencing NuGet package

Install the DynamicPDF Viewer for .NET NuGet Packages directly within Visual Studio's Package Manager. It will add the reference to the Viewer library and the necessary native libraries to the project.

Manual Referencing

There are two native libraries, and a .NET assembly is included to use with the .NET Framework 4.x in the bin folder in the zip file downloaded from our website. The following table provides the assembly details.

Assembly Name Assembly Version Framework Version Platform
DynamicPDF.Viewer.dll 3.x 4.x AnyCPU
DPDFViewerNative_x64.dll 3.x x64
DPDFViewerNative_x86.dll 3.x x86

There are two choices for adding the assembly reference to your project. You can add the assembly reference through the project's menu or use Visual Studio Toolbox to add the control.

Adding Assembly Reference

Open the project's references window by right-clicking on the project and selecting Add Reference.... From the Add Reference window, browse to the DynamicPDF.Viewer.dll and select OK to complete adding the assembly to your project. Add the necessary native library present in the downloaded folder to the project as per the project's platform. Set the build action as embedded resource or content and mark it to copy always.

Visual Studio Toolbox

You can add the Viewer control to the Visual Studio toolbox by right-clicking on the toolbox and selecting Choose Items menu item. Select DynamicPDF.Viewer.NETFramework.dll from the .NET Components tab. The PdfViewer, PdfViewerToolStrip, and PdfViewerNavigationPanel are added as controls in the toolbox. You can drag and drop the controls to use in the Windows Forms application, and this will add the product DLL to the project as a reference.

viewer tool box
Figure 1 – Visual Studio 2010 to 2019 Toolbox Integration Viewer Controls

Add the necessary native library present in the downloaded folder to the project as per the project's platform.

Visual Studio only adds the 32-bit versions of the three controls to the Visual Studio toolbox. However, you can target 64-bit applications. See below for a reference to the DynamicPDF Viewer assembly that targets x64-bit platforms.

Set the build action as embedded resource or content and mark it to copy always.

The accompanying XML files added by the assembly are used by IntelliSense and are not distributed with your product.

In this topic