In this “First Look”, we take a look at ActivePDF Toolkit, a flexible API-driven toolset that ASP and .NET developers can use to manipulate PDF files and forms.

Love it or hate it, Adobe’s Portable Document Format (PDF) is a common file format, making it easy for users and web developers alike to publish rich content to the Web. And it doesn’t stop at just static documentsââ,¬”user requirements are driving a whole new range of PDF technologies where invoices, receipts, statements and more are delivered in real-time using PDF.

From a development standpoint, it can be frustrating trying to generate these complex PDF files given some of the requirements users can come up with. Like anything, it makes a huge difference when you have the right tools for the job.

If you work with PDF files, one of the tools you can consider is ActivePDF Toolkit from ActivePDF, Inc. The company makes a number of PDF tools and server-based components, but ActivePDF Toolkit is a good starting point for integrating PDF functionality into ASP and .NET applications. ActivePDF Toolkit is touted as being the “Swiss Army Knife for PDF” and the ActivePDF Toolkit API can be used to append, stamp, merge and secure PDF files, as well as programmatically control PDF content.

Using ActivePDF Toolkit you can pre-populate PDF forms with data from any OLEDB or ODBC data source, enabling you to fill out “known fields” in PDF forms that may appear on your Web site for users. For example, you could have an order form where you filled in the customer’s name and shipping details for them and then they can complete the rest of the form for themselves.

Another key area where these tools will be useful is for putting watermarks and headers/footers on PDF documents. You could drop a “Draft” or “Confidential” watermark in the background of documents and/or use the “text painting” to put a custom header or footer on your PDF documents (similar to the footer that may appear on your Web site, with copyright, privacy, usage rules, etc.)

You can download an evaluation of ActivePDF Toolkit from here. When you first install ActivePDF, it can be a bit confusing as the installation program will create a program group under the Start menu, but the only thing that will be present in the group is a shortcut to the documentation.

The easiest way to see what ActivePDF Toolkit can do is to have a look at the sample applications that ship with the product. To get these samples up and running, you will need to have IIS up and running on your local machine– locate the ASPExamples folder within C:\Program Files\activePDF\APToolkit\ and right-click on the folder to setup web sharing using the Sharing and Security menu.

Note: The instructions here are for Windows XP SP1. If you are using a different Windows operating system, these options may be different. You can always use IIS to create a virtual directory to point to this location.

Once you have set this up, you can then browse the sample applications that ship with the product from http://localhost/aspexamples/
, which should open a page that looks something like the one shown below in Figure 1:


Figure 1: ActivePDF Sample Applications

These applications are simple examples of how you can use the ActivePDF toolkit, including:

  • Painting Text on Existing PDF’sââ,¬”Which demonstrates how you can programmatically
    add text to a PDF document.
  • Background Imagesââ,¬”Demonstrating how to lay a background or watermark
    image onto a PDF document.
  • Directory Listingsââ,¬”Which demonstrates how to retrieve a listing of
    PDF documents
  • Retrieving Input Valuesââ,¬”Shows how the API can be used to retrieve
    data entry made into PDF form fields.
  • Setting Form Valuesââ,¬”Shows how the API can be used to enter data into
    PDF form fields.
  • Merging/Concatenating Filesââ,¬”Demonstrates how two or more PDF files
    can be merged together with the API
  • Setting PDF Attributesââ,¬”Shows you can use the API to change PDF document
    attributes, including Author, Title, Subject, Keywords, etc. as shown below
    in Figure 2.
  • Extracting PDF Pagesââ,¬”Demonstrates how to remove a page from a PDF
    document using the API


Figure 2: Setting PDF Attributes

In addition to the sample applications, the documentation provides a number of tutorials that you can use to become acquainted with how ActivePDF Toolkit works and the ActivePDF Web site provides a number of sample applications that you can download to help you get started. If you use PDF files or forms in your web applications, you should definitely give this tool a look.

ActivePDF Toolkit
Company: ActivePDF
Price: US$ 399
System Requirements: Microsoft Windows NTÃ,® 4.0 (Service Pack 5 Minimum) or Microsoft WindowsÃ,® 95, 98, ME, 2000, XP, Pentium 200-MHz or higher with 32 MB of RAM and 5 MB of Hard Disk Space

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays