DocBook to pdf


Process docbook to pdf within ant script, using DocBook XSL stylesheets and XSL Formatting Objects .

DocBook to pdf processing ant4docbook let you writing ant script to process docbook
                      to pdf

By default, ant4docbook embed apache fop to process pdf files.
You may use your favorite fo processor as an external tool by setting ant4docbook.fop property. For example :

<project name="docbook-ant-task-to-pdf"> 
<property name="ant4docbook.fop" value="/path/to/apache-fop/fop" />

Pdf task parameters

Attribute Description Value Required
file docbook file yes
tofile output file <file name>.pdf yes
parameters output parameters see pdf parameters no
Element Description Value Required
parameter output parameters see pdf parameters no


<project name="docbook-ant-task-to-pdf" default="docbook-to-pdf"> 

  <taskdef name="dbk" 

  <target name="docbook-to-pdf"> 
    <dbk file="docbook.xml" tofile="generated-pdf-file.pdf" /> 
  <target name="docbook-to-pdf-with-many-parameters"> 
    <dbk file="docbook.xml" tofile="generated-pdf-file.pdf" 
      parameters="" /> 
  <target name="docbook-to-pdf-with-some-parameters"> 
    <dbk file="docbook.xml" tofile="generated-pdf-file.pdf">
      <parameter name="paper.type" value="A4" />