generate pdf with calabash and apache fop

Here should go questions about transforming XML with XSLT and FOP.
Posts: 264
Joined: Thu Nov 28, 2013 9:32 am
Location: Hamburg/Germany

generate pdf with calabash and apache fop

Post by Patrik » Tue Dec 16, 2014 9:48 am


I'm trying to convert my xslt transformation szenario for generating pdf files to an xproc transformation scenario. However, every pdf file I generated to far could not be opened by any reader cause it is invalid.

Here is my xproc file:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<p:input port="source"/>
<p:output port="result">
<p:pipe port="result" step="pdf"/>

<p:xsl-formatter name="pdf">
<p:input port="source">
<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>
<p:input port="parameters">
<p:with-option name="href" select="'Test.pdf'"/>
<p:with-option name="content-type" select="'application/pdf'"/>

Adding an fop configuration file with p:with-param (the same I uee for the oxygen built in fop) didn't change anything. So I'm quite lost now.

Does anybody have any working example for generating a pdf with apache fop and calabash as an oxygen transformation scenario?

Thanks and regards,


Posts: 2699
Joined: Tue May 17, 2005 4:01 pm

Re: generate pdf with calabash and apache fop

Post by adrian » Wed Dec 17, 2014 3:59 pm


In case anyone else encounters this, the problem turned out to be the generation of PDF with Calabash 1.0.18 (bundled with Oxygen v16.0) which has a bug in p:xsl-formatter. This bug is fixed in Calabash 1.0.19 and later (Oxygen v16.1 bundles 1.0.20):
Fixed bug where the output file wasn't being properly closed in p:xsl-formatter.

So, the solution is to either upgrade the version of Calabash bundled with Oxygen to 1.0.19 (or later) or upgrade Oxygen to v16.1 (recommended).

Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Post Reply