How to use “PDF Creator Pilot” on x64 systems with Microsoft Visual Studio.

There are two methods you can use to accomplish this in your .NET projects. Let’s suppose we have a C# project, and that “PDF Creator Pilot x64” is already installed.

Method #1

1) Open your project (or create a new one) and choose “Add Reference” in the Solution Manager (you can also do this from the main menu -> Project -> Add Reference…) and then select the “COM” tab.

2) In the component list find “PDFCreatorPilot Type Library” and press the “OK” button.

3) In the code file (*.cs) add this line:

using PDFCreatorLib;

and declare a variable somewhere in your code:

PDFDocument4 pdf = new PDFDocument4();
pdf.SetLicenseData("demo", "demo");
// more code...

4) You may set project target type to “x64” or leave it as “Any CPU”.

If all is done correctly, the PDF Creator Pilot now will be available to you in your project.

In some cases developers may not be able to add a reference as shown in the example above. In that case we recommend that you manually register the COM dll (PDFCreatorPilot.dll) with an administrator’s credentials:

regsvr32 PDFCreatorPilot.dll

After this please restart the Visual Studio and try to add the reference again. If this does not help, then please use Method #2.

Method #2

1) We need to manually create an interop wrapper library for .NET from the “PDF Creator Pilot x64” COM library. Find please where the “PDFCreatorPilot.dll” (x64 version) is located and create a simple batch file with the following line:

"C:\Program Files\Microsoft SDKs\Windows\v6.xx\bin\TlbImp.exe" "full\path\to\PDFCreatorPilot.dll" /out:"Interop.PDFCreatorPilotLib.dll" /namespace:PDFCreatorLib /machine:X64

2) Launch this file. This will produce the “Interop.PDFCreatorPilotLib.dll” file which is an interop library for the COM dll.

Note: the TlbImp.exe is a standard Windows SDK utility. If you do not have it on your machine,  please install the Windows SDK from the Microsoft website.

3) Open your project (or create a new one) and choose “Add Reference” in the Solution Manager (you can also do this from the main menu -> Project -> Add Reference…) and select the “Browse” tab. In the file list find “Interop.PDFCreatorPilotLib.dll” created in the previous step and press the “OK” button.

4) In the code file (*.cs) add this line:

using PDFCreatorLib;
/* PDFCreatorLib is a namespace you've specified as a parameter for TlbImp.exe. */

and declare a variable somewhere in your code:

PDFDocument4 pdf = new PDFDocument4();
pdf.SetLicenseData("demo", "demo");
// more code...

5) You may set the project target type to “x64” or leave it as “Any CPU”.

If all is done correctly, the PDF Creator Pilot now will be available to you in your project.

Max Filimonov