Apache

FOP 0.93 improves PDF from XML !

After nearly 3.5 years, the Apache Foundation has released a stable update to their FOP software. This is great news for people using this free java program to convert XML to PDF files. More information and the download can be found at http://xmlgraphics.apache.org/fop/ Among the many changes and fixes are the following.

  • support for the use of Open Type fonts

  • support for SVG in fo:instream-foreign objects for RTF output

  • support for PDF/A-1b and PDF/X-3:2003

  • support for kerning

  • support for XMP metadata

  • lots of bug fixes

  • including a complete redesign of the FOP codebase


I did have some problems following their instructions to install my own fonts. Here is what I finally did after copying the fonts I wanted to the FOP directory. NOTE, with this release you can skip step one and go straight to step 2 if you are using a TTF font.

  1. Correct font conversion process after copying the font files "something.ttf" to the directory where FOP is located.
    C:\downloads\fop-0.93>java -cp build\fop.jar;lib\avalon-framework-4.2.0.jar; lib\commons-logging-1.0.4.jar; lib\commons-io-1.1.jar org.apache.fop.fonts.apps.TTFReader arial.ttf arial.xml
    TTF Reader for Apache FOP 0.93Parsing font...
    Reading arial.ttf...
    Number of glyphs in font: 1674
    3 cmap tables
    CMAP format: 4
    Creating xml font file...
    Creating CID encoded metrics...
    Writing xml font file arial.xml...
    This font contains no embedding license restrictions.XML font metrics file successfully created.

  2. Uncomment this in the userconfig.xml file in the fop directory "conf"; if you are using a TTF font you can also delete the "font metrics-url=" portion for each font as this will be generated automatically.
    <font metrics-url="arial.xml" kerning="yes" embed-url="arial.ttf">
    <font-triplet name="Arial" style="normal" weight="normal"/>
    <font-triplet name="ArialMT" style="normal" weight="normal"/>
    </font>
    <font kerning="yes" embed-url="arial.ttf">
    <font-triplet name="Arial" style="normal" weight="normal"/>
    <font-triplet name="ArialMT" style="normal" weight="normal"/>
    </font>

  3. In the fonts.fo file located in the fop directory/examples/fo/basic, wherever you see font-family="Helvetica" change it to font-family="Arial".

  4. C:\downloads\fop-0.93>fop -c conf/userconfig.xml C:\downloads\fop-0.93\examples\fo\basic\fonts.fo fonts2.pdf


Now there is finally a new stable release to export my docbook xml files with. If only they could get the floats feature working. PS, I have a package of tools for working with fop and xml docbook on Windows if anyone is interested.