Next / Previous / Contents / Shipman's homepage

1. Direct construction of PDF files from Python

The Adobe PDF (Portable Document Format) standard is a ubiquitous documentation format. The purpose of the fohelpers Python module is to allow Python programs to generate PDF files directly.

There are many routes to PDF, but the author has some experience with the XSL-FO standard, the eXtensible Stylesheet Language Formatting Objects.

Before you read any further, you should be familiar with these technologies.

The current document is intended to provide an alternative route to PDF that does not use XSLT, because XSLT operates only on XML input files. We want to provide a route for situations where the content comes from databases or other sources, to which XSLT has no direct interface.

For a readable, well-organized, approachable book on XSL-FO, the author recommends this one.

Pawson, Dave. XSL-FO: Making XML Look Good in Print. O'Reilly, 2002, ISBN 0-596-00355-2.

The translation of an XSL-FO document into the final PDF can be accomplished with several packages; refer to the Wikipedia page for XSL-FO for links. The NM Tech Computer Center has the XEP package from RenderX installed under an academic license; this package produces high-quality output.