The PDFlib Cookbook is a collection of PDFlib coding fragments for solving specific problems. It is maintained as a growing list of sample programs. The Cookbook topics are written in the Java language, but can easily be ported to other programming languages since the PDFlib API is almost identical for all supported language bindings. For some topics, code in other languages like PHP or C is provided. Each Cookbook topic denotes the PDFlib product required for its execution.
Each topic can be viewed individually in the browser together with its source code, description and output PDF. For a complete list of all topics currently being available, see All Topics Overview.
For the most recently published and newest topics see the change log.
The complete PDFlib Cookbook Package including the Java source files, all needed input data, and an ANT build file is available for download here.
Please note the following when using the PDFlib Cookbook topics with PDFlib Lite:
Each Cookbook topic denotes the PDFlib product required for its execution in the comment on top of the source code. An error message will appear when compiling a Cookbook topic containing functions which are not supported by PDFlib Lite, such as Textflow, tables, or layers functions, for example.
Unicode encoding is not supported by PDFlib Lite. If a topic calls the PDFlib function load_font() with Unicode encoding change "unicode" to "winansi" to make the topic work with PDFlib Lite.