Components for Developers
© 2000-2016, Two Pilots

PDF Library   Virtual Printer   Converters   Squirrel   HTML_QuickForm   Design Service

Two Pilots blog

Archive for August, 2010

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

Tuesday, August 24th, 2010

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: http://www.microsoft.com/downloads/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b&displaylang=en

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.

You may download the sample project here. This project contains a manually created interop DLL, and a C# project that refers this interop.

Max Filimonov,
Two Pilots Developers Team.

Merge and Split PDFs with PDF Creator Pilot

Tuesday, August 17th, 2010

Do you need to split or merge PDF files and reorganize pages in your PDF documents? If yes, then PDF Creator Pilot library can help you do this. PDF Creator Pilot allows you to not only split, merge, and reorganize pages in your PDFs, but also to create tree-like outlines (bookmarks), annotations, watermarks, thumbnails, and interactive AcroForm elements for your PDF documents.

PDF Library has the following methods for splitting, merging, and reorganizing pages:

  • Append – This method appends the contents of a previously saved PDF file (not a BLOB) to a newly created (or opened) PDF document.
  • Open – This method opens an existing PDF document, then reads and parses its contents.
  • AddPage – This method creates a new PDF page, appending it to the end of the PDF document. It does not set the new page as current.
  • DeletePage – This method removes the specified page from a PDF document.

With the help of PDF Creator Pilot, you can easily and quickly manage your PDFs, reduce the size of PDF files, and quickly combine a group of files using the merge feature.

Artem Golubnichenko


PDF Library   Virtual Printer   Converters   Squirrel   HTML_QuickForm   Design Service

 

Support | Blog | Forum | Contacts | About | Site map

© 2000-2016, Two Pilots