PDFlib Cookbook

cookbook

Source Code Cookbook for the PDFlib Product Family

The PDFlib Cookbook is a collection of PDFlib coding fragments for solving specific PDF creation problems. It is maintained as a list of sample programs. PDFlib Cookbook topics are offered in Java and PHP versions, but can easily be ported to other programming languages since the PDFlib API is identical for all supported language bindings. The Cookbook topics can be used with products of the PDFlib family as follows (the exact product requirements are stated in comments at the start of each topic):

  • Cookbook topics in the category PDF Import, all clone_* samples as well as a few other topics in other categories require PDFlib+PDI or PPS.
  • Cookbook topics in the category Block Handling and PPS require the PDFlib Personalization Server (PPS).
  • All other Cookbooks can be used with the PDFlib product.
  • Examples for the pCOS interface are presented in the pCOS Cookbook; they require PDFlib+PDI or PPS, or another product which includes the pCOS interface, i.e. PDFlib TET, PDFlib PLOP or PDFlib PLOP DS.

All Cookbook topics can be used with the free PDFlib evaluation packages.

Browse all PDFlib Cookbook Topics

Each topic can be viewed individually in the browser together with its source code, description and output PDF. For a complete list of all available topics see Browse all Topics.

For the most recently published and newest topics see the change log.

PDFlib Cookbook for Java

The PDFlib Cookbook package for Java contains the Java source files and sample input data as well as an Ant build file and an Eclipse project. The Cookbook topics can conveniently be compiled and run with the Java build tool Apache Ant. Alternatively, you can manually compile and run the samples.

The PDFlib Cookbook package contains an Eclipse project file that allows the direct import of the PDFlib Cookbook into an Eclipse workspace.

As a prerequisite for compiling and executing the PDFlib Cookbook topics the PDFlib binary library for Java (e.g. libpdflib_java.so for Linux) and corresponding .jar file must be installed. You can download the appropriate PDFlib evaluation package here.

Download the PDFlib Cookbook package for Java (includes Java code for each topic plus required sample input data):

PDFlib-Java-Cookbook-2022-08.zip

PDFlib-Java-Cookbook-2022-08.tar.gz

PDFlib Cookbook for PHP

The PDFlib Cookbook package for PHP contains the PHP scripts and sample input data, as well as an index.html overview page.

As a prerequisite for compiling and executing the PDFlib Cookbook topics the PDFlib binary library for PHP (e.g. php_pdflib.so for Linux) must be installed. You can download the appropriate PDFlib evaluation package here.

Download the PDFlib Cookbook package for PHP (includes PHP code for each topic plus required sample input data):

PDFlib-PHP-Cookbook-2022-08.zip

PDFlib-PHP-Cookbook-2022-08.tar.gz

PDFlib Cookbook packages for use with PDFlib 9

Download an older PDFlib Cookbook package for Java for use with PDFlib 9:

PDFlib-Java-Cookbook-2022-01.zip

PDFlib-Java-Cookbook-2022-01.tar.gz

Download the PDFlib Cookbook package for PHP for use with PDFlib 9:

PDFlib-PHP-Cookbook-2022-01.zip

PDFlib-PHP-Cookbook-2022-01.tar.gz