Chapter 13. Creating printable output

Table of Contents
Get the files
Install FOP
Install JFOR
The first steps towards printable output
Further Reading
Use additional applications to transform XML to printable documents

While Jade/OpenJade use built-in backends to create HTML and printable output, XSLT engines use a different path to arrive at the same end: They are capable to transform the XML document to "Formatting Objects". The result is a temporary XML document which contains all data and the necessary formatting informations. This temporary document is fed to another application (a formatting objects processor) to create the final printable output.

FOP is a Java application to directly create PDF, MIF, PCL, or plain text files from FO output. Alternatively, if you pass a XML document and a XSL stylesheet, FOP will use Xerces and Xalan to do the XSLT transformation on the fly.

JFOR is another Java application which creates RTF files from FO output. RTF files can be viewed and printed with most word processors.

xmltex and the PassiveTeX macros play a similar role for XML as Jade's TeX backend and the JadeTeX macros play for SGML (the macros are actually closely related). PassiveTeX uses the FO output of an XSLT engine to generate PDF output. While this sounds more complicated than directly creating PDF, this approach makes use of the superior layout capabilities of the TeX system. The macros were already installed with the TeX installation, so we just need to look at a few examples how to use them.

Get the files

  1. FOP

  2. JFOR. Pick the latest binary package (jfor-x.y.z.jar)