Apache FOP 1.0 released
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:
- a language for transforming XML documents (XSLT), and
- 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
http://www.w3.org/1999/XSL/Format. Here's an example from http://www.renderx.com/tutorial.html (a commercial FO processor):
<?xml version="1.0" encoding="iso-8859-1"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="my-page"> <fo:region-body margin="1in"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="my-page"> <fo:flow flow-name="xsl-region-body"> <fo:block>Hello, world!</fo:block> </fo:flow> </fo:page-sequence> </fo:root>
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
block are similar to HTML's
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.
What are the major changes?
Re: What are the major changes?
"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.
Ben Melbourne Jul 04, 2015
Randy Shoup Jul 03, 2015