Apache » Cocoon »

  Cocoon FOP

Cocoon FOP 1.0

Basic usage

Basic usage

Declaration of the the needed serializer(s)

In the <map:serializers> section of the section, add this :

  • for pdf generation :
<map:serializer name="fo2pdf" src="org.apache.cocoon.serialization.FOPSerializer" 
  • for pcl generation :
<map:serializer name="fo2pcl" src="org.apache.cocoon.serialization.PCLSerializer" 
  • for ps generation :
<map:serializer name="fo2pdf" src="org.apache.cocoon.serialization.FOPSerializer" 

Serializers usage in the pipeline

In the pipelines, just add this for example :
<map:match pattern="hello.pdf">
  <map:generate src="hello.fo" type="file"/>
  <map:serialize type="fo2pdf"/>
You will need the sample hello.fo file to be located in the same directory as the sitemap.xmap

Java options

When Cocoon is running on a headless envirionment, the java runtime must be notified using the command line option "-Djava.awt.headless=true"

This can be easilly done when running Cocoon inside apache Tomcat : just set the CALALINA_OPTS environment variable.

export CATALINA_OPTS="-Djava.awt.headless=true"
Errors and Improvements? If you see any errors or potential improvements in this document please help us: View, Edit or comment on the latest development version (registration required).