Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Apache FOP 1.0 released

Apache FOP 1.0 released

Leia em Português

This item in japanese


On Wednesday, the Apache Foundation announced the release of Apache FOP 1.0, a project that has been a decade in the making. Apache FOP, or Formatting Objects Processor, started off its life in the XML project at Apache before moving (together with Batik, a Java-based SVG renderer) to the XMLGraphics project back in 2004.

Apache FOP provides a means to turn XML documents into a variety of print-ready formats, such as PDF, PNG or even to others like HTML. Its history goes back to the first release of XSL from the W3C. Although most will conflate XSL with that of the XSL Transformation language itself, XSL was created primarily for the benefit of and by the publishing industry. As a result, the XSL specification covers both the language (eXtensible Stylesheet Language) and also the XSL Formatting Objects specification. From the XSL abstract:

This specification defines the features and syntax for the Extensible Stylesheet Language (XSL), a language for expressing stylesheets. It consists of two parts:

  1. a language for transforming XML documents (XSLT), and
  2. an XML vocabulary for specifying formatting semantics.

What most will think of as XSL is actually XSLT, the first part of the specification. The XSL specification also defines a mini language for defining how print text should be laid out in the form of XSL Formatting Objects, or just FO, in the same specification. (It's this name which gives rise to the Apache FO Processor, and thus the name of the project itself.)

Although CSS 1 was released in 1996, and CSS 2 was released in 1998, neither of them had the ability to work with some print-fidelity requirements such as footnotes, page number references, separating flow of columnar text (i.e. automatically flowing the text across a number of columns, instead of pre-splitting them into separate DIVs). When XSL FO was release in 2001 as part of the XSL specification, there were few processors available to be able to process them. Apache FOP was one of the first, but seemed to stall at version 0.20 (released in 2003) until the reboot at FOP 0.93 (released in 2007). In fact, this split was used to demonstrate OSGi's capability of loading different versions of JARs at an OSGi JSIG event at Sun a few years ago.

An example FO document looks like traditional XML, with an fo namespace, bound to Here's an example from (a commercial FO processor):

<?xml version="1.0" encoding="iso-8859-1"?>
<fo:root xmlns:fo="">
    <fo:simple-page-master master-name="my-page">
      <fo:region-body margin="1in"/>
  <fo:page-sequence master-reference="my-page">
    <fo:flow flow-name="xsl-region-body">
      <fo:block>Hello, world!</fo:block>

The content in fo:layout contains the style (such as what the page margins are, whether page numbers should be shown and so forth; it supports multiple styles, so you can have separate 'main page' and 'index pages' styles), followed by the fo:page-sequence, which would correspond to that set of pages (e.g. a chapter). Inside, the flow and block are similar to HTML's div and p settings.

Whist it may appear verbose, this is often an intermediary format from something like a MediaWiki or WikiText format. (Eclipse WikiText can be translated into DocBook or XSL-FO already; in fact, a number of DocBook processors generate XSL-FO, which in turn, can be compiled into PDF via tools like Apache FOP.) Maven's site target used Apache FOP to be able to generate PDF versions of the site with the pdf plugin.

Apache FOP 1.0 is not yet fully compliant with the XSL FO specification; a compliance page lists more information about what is supported at the current time.

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • What are the major changes?

    by Wilfred Springer,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Just wondering what has pushed this to version 1.0. I have been using FOP for ages, and according to what you state above, it is still not fully compliant with the XSL FO specification. Which makes me wonder what the change to version 1.0 signifies.

  • Re: What are the major changes?

    by Wouter Lagerweij,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    From the site:

    "The Apache FOP team is proud to present to you this production quality codebase. FOP 1.0 provides a good subset of the W3C XSL-FO 1.0 and 1.1 Standards. Its stable, 1.0 designation provides added recognition as the productive tool it has been for years."

    So I guess the 1.0 is not about functionality, but more about quality.

  • Re: What are the major changes?

    by Michael Gutbier,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    From the site:
    So I guess the 1.0 is not about functionality, but more about quality.

    ... and about publicity. Which is good for the project. FOP proved very useful in several projects.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p