Apache FOP

XSL-FO is an XML format used for driving publishing tools. In order to use it a program called a renderer is necessary. The most common target for rendering is the PDF format, although there are other output formats in use such as PCL (HP Printer Control Language) or RTF. An open-source engine is available from the Apache project named FOP that will converts XSL-FO into PDF. This is suitable for use in the following areas:

For many versions now, Stylus Studio® has included the most stable version of Apache FOP, 0.20.5. (The next version, 0.92 beta, is still in beta form, and is not yet suitable for inclusion. However, it could be downloaded manually and used as an external post-processor with Stylus Studio®.)

Configuring Stylus Studio® for Apache FOP Use

To switch to using PDF output, we'll need to get to the Scenarios dialog for the XSLT or XQuery program we're working on. Then go to the "Post-process" tab.

Using the Apache FOP API

Switch your processing from "Do not perform..." to "Post process with Apache FOP", and you are set to go. (Note that although you can install any XSL-FO to PDF renderer, only Apache FOP and RenderX XEP are included with Stylus Studio®.)

Now, we are ready to begin actually using Stylus Studio® and the Apache FOP rendering engine together.

Transforming XML and Rendering the XSL-FO File with Apache FOP

Choose your XSL-FO file. If you were to use the same ones as used on the RenderX XEP demonstration page for this demonstration, you could do File|Open and navigate to the directory in which you unzipped them to get:

Running an XSL:FO Stylesheet with Apache FOP

Next, choose the Scenario Properties dialog, either from the XSLT or XQuery menu or from the Configuring the Apache FOP Editor to Generate PDF button, and set the Source XML URL. For the XPath 1.0 specification, choose the xpath.xml file that was in the same directory as the .xsl file above. (In your copy, it might be called REC-xpath-19991116.xml)

Next, choose the Post-process tab. There, select "Post process with Apache FOP". That's all it takes to configure FOP to work with Stylus Studio®.

Now choose XSLT|Preview Result (or XQuery|Preview Result) or click on the fop apache icon, and the preview window will show the PDF as generated by Stylus Studio® driving Apache FOP.

Apache FOP and Stylus Studio (Click to enlarge)
(click to enlarge)

Whether you are interested in XSL-FO, Apache FOP, or Stylus Studio®, we've got the goods. Try it yourself by heading over to here to download a copy of Stylus Studio® with Apache FOP, and explore both the XML Editor and the XML Publishing module for designing beautiful XML reports.

PURCHASE STYLUS STUDIO ONLINE TODAY!!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Try STYLUS Apache FOP Tools

Download a free trial of our powerful tools for building advanced publishing applications using the Apache FOP processor.

Convert XML to PDF

Publish XML to PDF with Stylus Studio's XSL-FO Editor and visual XSL:FO tools featuring support for the world's leading XSL:FO processing components.

What's New for Stylus Studio® X16?

New XQuery & Web Services Tools, Support for MySQL, PostgreSQL, HL7 EDI, Microsoft .NET Code Generation and much more!

Why Pay More for XML Tools?

With Stylus Studio® X16 XML Enterprise Suite, you get the most comprehensive XML tool suite at one incredibly low price. Value: it's just one of many reasons why smart XML developers are choosing Stylus Studio!

Stylesheet Designer

Watch our new online video tutorial: An Introduction to Stylesheet Design covers in detail how to visually design publishing and content management applications using W3C standards including XML, XSL, XSL:FO, XSLT and XQuery.

 
Free Stylus Studio XML Training:
W3C Member