DocBook to pdf task

Description

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

DocBook to pdf processing

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" />
[...]
</project>

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
Attribute Description Value Required
parameter output parameters see pdf parameters no

Examples

<project name="docbook-ant-task-to-pdf" default="docbook-to-pdf">
	<taskdef name="dbk"
		classname="net.sourceforge.ant4docbook.taskdefs.DocbookTask"
		classpath="PATH/TO/ant4docbook.jar"/>
	
	<target name="docbook-to-pdf">
		<dbk file="docbook.xml" tofile="generated-pdf-file.pdf" />
	</target>
	
	<target name="docbook-to-pdf-with-many-parameters">
		<dbk file="docbook.xml" tofile="generated-pdf-file.pdf"
			parameters="pdf.properties" />
	</target>
	
	<target name="docbook-to-pdf-with-some-parameters">
		<dbk file="docbook.xml" tofile="generated-pdf-file.pdf">
			<parameter name="paper.type" value="A4" />
		</dbk>
	</target>
</project>