The source code is covered by the Apache license.
Ant task to create several document formats out of xml files using the iText framework.
It can be used to create your documentation in several output formats from one source. Currently iText supports PDF (default), HTML and RTF. It also supports your own tag maps, headers and footers. The distribution contains some examples token from the iText website. This site contains also an excellent tutorial.
... <available property="iTextTask.present" classname="org.apache.tools.ant.taskdefs.optional.IText"/> ... <target name="tdef" depends="prepare" if="iTextTask.present"> <taskdef name="iText" classname="org.apache.tools.ant.taskdefs.optional.IText"/> </target>
Attribute | Description | Required |
dest | Where to place the generated file. The ending of the file is not taken into account. | Yes |
srcdir | Input file (XML file) to parse. File must exist | Yes |
format | Desired output format ('pdf', 'html' or 'rtf'. Default is 'pdf' | No |
tagmap | Tag map to use | No |
header | Header for every page (PDF only) | No |
footer | Footer for every page. Use 'pagenumbering', if you like to have the page numbers in the footer (PDF only) | No |
<iText src="Plain.xml" dest="Test1.pdf" header ="My header" footer ="pagenumbering" />Builds a html document out of WithTags.xml with tag map TagMap.xml. Every page has a footer 'My footer'.
<iText src="WithTags.xml" dest="${tmp.dir}/Test2.html" tagmap="TagMap.xml" footer ="My footer" format="html" />Builds a rtf document out of WithTags.xml with tag map TagMap.xml. Pages have neither a footer nor a header.
<iText src="src/etc/testcases/taskdefs/optional/WithTags.xml" dest="${tmp.dir}/Test3.rtf" tagmap="src/etc/testcases/taskdefs/optional/TagMap.xml" format="rtf" />