Skip to content
ComPDF

Integrating the PDF Generation SDK

Running Examples

  1. Open the solution file Samples.sln in Visual Studio.
  2. Select a sample project in the Solution Explorer and set it as the startup project.
  3. Build and run the example.

Alternatively, you can open a command-line tool in the project folder and run the example via commands:

powershell
dotnet run

Integrating ComPDF Generation into a Project

You can perform integration manually or via nuget as described below. This section will help you build a PDF generation application.

Manual Integration

  1. Start a new instance of Visual Studio 2026 and create a new .NET Core console application (File > New > Project...), then click OK to confirm the creation.

    CreateNewProject

  2. Find the Solution Explorer on the right side of the screen, select the project, right-click on the project, and click the "Properties" option in the menu, which will open the properties tab.

    Confirm that ".NET Core 2.1" (or a later version) is used as the target framework for the application.

    Version

  3. Right-click "Dependencies" and then click "Add Project Reference", which will open the "Reference Manager" dialog. Click the option at the bottom of the dialog, find the corresponding "ComPDFGeneration.dll", select it, and click Add.

    AddReference

  4. In the Solution Explorer, right-click the project and find the "Add" option under the submenu Add an existing item....

    Navigate to the library location again, select the file type as All Files (*.*) and select CPDFGenerationNative.dll, libpng16.dll, zlib1.dll. Click "Add".

  5. Select the .dll in the Solution Explorer. A properties window will appear below; in it, change the build action to Content. Set the "Copy to Output Directory" to Copy always.

    CopyAlways

Integration Using Nuget Package

  1. Perform the first two steps of manual integration.

  2. Right-click the project dependencies and click Manage Nuget Packages..., which will open the Nuget Package Manager.

  3. Click the Browse tab near the top of the package manager, and enter in the search bar:

    ComPDF_Generation.NetCore
  4. Select the ComPDF_Generation.NetCore package, then click the Install button in the panel containing package information. If prompted or if an external dialog opens for confirmation, click OK.

    After installation is complete, you will see a reference to the package under Dependencies in the Solution Explorer.