Skip to content
Guides

How to Make a Windows Program in C# with ComPDFKit Conversion SDK

Create a New Windows Project

  1. Fire up Visual Studio 2017, choose File -> New -> Project..., and then select Visual C# -> Windows Desktop -> Console App(.NET Framework) as shown in Figure 2-1.

image-20230419165235343Figure 2-1

  1. Choose the options for your new project as shown in Figure 2-2. Please make sure to choose .NET Framework 4.6.1 as the programming framework.

image-20230419165329455 Figure 2-2

  1. Place the project to the location as desired. Then, click OK.

Add ComPDFKit Conversion SDK Package

  1. Copy all files in the "lib" folder to the project folder.

  2. Add ComPDFKit Conversion SDK dynamic library to References. In order to use ComPDFKit Conversion SDK APIs in the project, you must add the reference to the project first.

  • In Solution Explorer, right-click the project and click Add -> Reference…

image-20230419165606808

  • In the Add Reference dialog, click the Browse tab, navigate to the project folder, select "ComPDFKit_Conversion.dll" dynamic library, and then click OK.

image-20230419171114989

  1. Add ComPDFKit Conversion SDK library to the project. Add the "x64" and "x86" folder into the project. Please make sure to set the property Copy to Output Directory of "CPDFConverterNative.dll" and "opencv_world420.dll" to Copy if newer. Otherwise, you should copy it to the same folder with the executable file manually before running the project.

image-20230419171505338

  1. Copy the "resource" folder to the project folder. Please make sure to set the property Copy to Output Directory of all files in the "resource" folder to Copy if newer. Otherwise, you should copy it to the same folder with the executable file manually before running the project.

image-20231115132126738