<?xml version="1.0"?>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- iText, a JAVA - PDF library                                      -->
<!-- $Id:: build.xml 45480 2009-01-16 15:05:22Z ryandesign@macports#$ -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<project name="iText" default="help" basedir=".">

    <property environment="env" />

    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <!-- Some general properties                                          -->
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <target name="properties" description="--> Sets a number of common properties">
        <property name="itext.home" value="." />
        <property name="itext.src" value="${itext.home}/src" />
        <property name="itext.classes" value="${itext.home}/classes" />
        <property name="itext.lib" value="${itext.home}/lib" />
        <property name="itext.docs" value="${itext.home}/docs" />
        <property name="itext.www" value="${itext.home}/www" />
        <property name="itext.tutorial" value="${itext.www}/tutorial" />
        <property name="itext.examples" value="${itext.www}/examples" />
        <property name="itext.dist" value="${itext.home}/dist" />
        <property name="itext.sf" value="${itext.dist}/sf" />
        <property name="itext.bin" value="${itext.home}/bin" />
        <property name="itext.cvsroot" value=":pserver:anonymous@cvs.itext.sourceforge.net:/cvsroot/itext" />
        <property name="defaultnumber" value="invalid" />
        <available property="j2ee.jar" value="${env.J2EE_HOME}/lib/j2ee.jar" file="${env.J2EE_HOME}/lib/j2ee.jar"/>
        <property name="j2ee.jar" value="COULD_NOT_FIND_J2EE_JAR"/>

        <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
        <!-- The classpath when the release is done                           -->
        <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

        <path id="classpath">
            <pathelement location="${j2ee.jar}" />
            <pathelement location="${itext.bin}/iText.jar" />
            <pathelement location="${itext.bin}/iTextXML.jar" />
            <pathelement location="${itext.bin}/iTextHYPH.jar" />
            <pathelement location="${itext.examples}" />
        </path>
    </target>

    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <!-- Help                                                             -->
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

    <target name="help" description="--> shows the help screen">
        <echo>Using ANT for ${ant.project.name}</echo>
        <echo />
        <echo>INSTALLING iText</echo>
        <echo>ant install: downloads and installs the most recent release in one command</echo>
        <echo>ant install.cvs: downloads and installs the current CVS version in one command</echo>
        <echo />
        <echo>GETTING THE CODE</echo>
        <echo>ant checkout: checks out the code from CVS</echo>
        <echo>ant download: downloads some files needed to build a release</echo>
        <echo>ant download.cvs: downloads the most recent VERSION of the code</echo>
        <echo>ant download.site: downloads the most recent RELEASE of the code</echo>
        <echo />
        <echo>COMPILING THE CODE</echo>
        <echo>ant compile: compiles iText without RTF and XML functionality</echo>
        <echo>ant compileWithXML: compiles iText completely</echo>
        <echo />
        <echo>JARRING THE CODE</echo>
        <echo>ant jar: compiles and jars iText without RTF and XML functionality</echo>
        <echo>ant jarWithXML: compiles and jars iText completely</echo>
        <echo />
        <echo>ARCHIVING THE SOURCE</echo>
        <echo>ant srczip: makes zipfiles with the sourcecode</echo>
        <echo>ant srctargz: makes tar.gz-files with the sourcecode</echo>
        <echo />
        <echo>DOCUMENTATION</echo>
        <echo>ant javadoc: generates the API documentation</echo>
        <echo>ant docstargz: generates the API docs and puts them in a tar.gz-file</echo>
        <echo>ant tutorialtargz: generates several tar.gz-files with documentation (tutorial, examples,...)</echo>
        <echo>ant examples: generates most of the PDF files of the tutorial</echo>
        <echo />
        <echo>RELEASE</echo>
        <echo>ant release: makes a complete iText release</echo>
        <echo>ant -Dnumber=XXX release.sf: prepares a release XXX for sourceforge</echo>
    </target>

    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <!-- Getting the code                                                 -->
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

    <target name="checkout" depends="properties" description="--> checks out the source code form CVS">
        <echo>Logging in: the password for user anonymous is empty;</echo>
        <echo>just press enter when asked for it</echo>
        <cvs cvsroot="${itext.cvsroot}" command="login" />
        <cvs cvsroot="${itext.cvsroot}" package="www" dest="${itext.home}" />
        <cvs cvsroot="${itext.cvsroot}" package="src" dest="${itext.home}" />
    </target>

    <target name="download" depends="properties" description="--> downloads some files needed to make a release">
        <mkdir dir="${itext.www}" />
        <get src="http://www.lowagie.com/iText/logo.gif" dest="${itext.www}/logo.gif" verbose="true" />
        <get src="http://www.lowagie.com/iText/iText.gif" dest="${itext.www}/iText.gif" verbose="true" />
        <get src="http://www.lowagie.com/iText/iTextLogo.gif" dest="${itext.www}/iTextLogo.gif" verbose="true" />
        <mkdir dir="${itext.tutorial}" />
        <get src="http://www.lowagie.com/iText/tutorial/Chap0101.png" dest="${itext.tutorial}/Chap0101.png" verbose="true" />
        <get src="http://www.lowagie.com/iText/tutorial/Chap0106.png" dest="${itext.tutorial}/Chap0106.png" verbose="true" />
        <get src="http://www.lowagie.com/iText/tutorial/Chap0106dos.png" dest="${itext.tutorial}/Chap0106dos.png" verbose="true" />
        <mkdir dir="${itext.examples}" />
        <get src="http://www.lowagie.com/iText/examples/harbour.wmf" dest="${itext.examples}/harbour.wmf" verbose="true" />
        <get src="http://www.lowagie.com/iText/examples/pngnow.png" dest="${itext.examples}/pngnow.png" verbose="true" />
        <get src="http://www.lowagie.com/iText/examples/cover.png" dest="${itext.examples}/cover.png" verbose="true" />
        <get src="http://www.lowagie.com/iText/examples/H.gif" dest="${itext.examples}/H.gif" verbose="true" />
        <get src="http://www.lowagie.com/iText/examples/caesar_coin.jpg" dest="${itext.examples}/caesar_coin.jpg" verbose="true" />
        <get src="http://www.lowagie.com/iText/examples/hitchcock.png" dest="${itext.examples}/hitchcock.png" verbose="true" />
        <get src="http://www.lowagie.com/iText/examples/myKids.jpg" dest="${itext.examples}/myKids.jpg" verbose="true" />
        <get src="http://www.lowagie.com/iText/examples/raf.jpg" dest="${itext.examples}/raf.jpg" verbose="true" />
        <get src="http://www.lowagie.com/iText/examples/vonnegut.gif" dest="${itext.examples}/vonnegut.gif" verbose="true" />
        <get src="http://www.lowagie.com/iText/examples/watermark.jpg" dest="${itext.examples}/watermark.jpg" verbose="true" />
        <get src="http://www.lowagie.com/iText/examples/12.tif" dest="${itext.examples}/12.tif" verbose="true" />
        <get src="http://www.lowagie.com/iText/examples/338814-00.tif" dest="${itext.examples}/338814-00.tif" verbose="true" />
        <mkdir dir="${itext.bin}" />
        <get src="http://itext.sourceforge.net/downloads/iTextAsian.jar" dest="${itext.bin}/iTextAsian.jar" verbose="true" />
        <get src="http://itext.sourceforge.net/downloads/iTextAsianCmaps.jar" dest="${itext.bin}/iTextAsianCmaps.jar" verbose="true" />
        <get src="http://itext.sourceforge.net/downloads/iTextHYPH.jar" dest="${itext.bin}/iTextHYPH.jar" verbose="true" />
        <get src="http://itext.sourceforge.net/downloads/barcodefonts.zip" dest="${itext.bin}/barcodefonts.zip" verbose="true" />
    </target>

    <target name="download.cvs"  depends="properties, checkout, download" description="--> downloads the most recent version of the code">
        <echo>Remark:</echo>
        <echo>The CVS version is the most recent version of the code.</echo>
        <echo>It may not always compile.</echo>
        <echo>Use ant download.site to download working code.</echo>
    </target>

    <target name="download.site"  depends="properties, download" description="--> downloads the most recent release of the code">
        <mkdir dir="${itext.dist}" />
        <get src="http://itext.sourceforge.net/downloads/src.tar.gz" dest="${itext.dist}/src.tar.gz" verbose="true" />
        <get src="http://itext.sourceforge.net/downloads/srcXML.tar.gz" dest="${itext.dist}/srcXML.tar.gz" verbose="true" />
        <get src="http://itext.sourceforge.net/downloads/www.tar.gz" dest="${itext.dist}/www.tar.gz" verbose="true" />
        <get src="http://itext.sourceforge.net/downloads/tutorial.tar.gz" dest="${itext.dist}/tutorial.tar.gz" verbose="true" />
        <get src="http://itext.sourceforge.net/downloads/examples.tar.gz" dest="${itext.dist}/examples.tar.gz" verbose="true" />

        <mkdir dir="${itext.src}" />
        <gunzip src="${itext.dist}/src.tar.gz" dest="${itext.dist}/temp.tar" />
        <untar src="${itext.dist}/temp.tar" dest="${itext.src}" />
        <delete file="${itext.dist}/temp.tar" />
        <gunzip src="${itext.dist}/srcXML.tar.gz" dest="${itext.dist}/temp.tar" />
        <untar src="${itext.dist}/temp.tar" dest="${itext.src}" />
        <delete file="${itext.dist}/temp.tar" />

        <mkdir dir="${itext.www}" />
        <gunzip src="${itext.dist}/www.tar.gz" dest="${itext.dist}/temp.tar" />
        <untar src="${itext.dist}/temp.tar" dest="${itext.www}" />
        <delete file="${itext.dist}/temp.tar" />
        <mkdir dir="${itext.tutorial}" />
        <gunzip src="${itext.dist}/tutorial.tar.gz" dest="${itext.dist}/temp.tar" />
        <untar src="${itext.dist}/temp.tar" dest="${itext.tutorial}" />
        <delete file="${itext.dist}/temp.tar" />
        <mkdir dir="${itext.examples}" />
        <gunzip src="${itext.dist}/examples.tar.gz" dest="${itext.dist}/temp.tar" />
        <untar src="${itext.dist}/temp.tar" dest="${itext.examples}" />
        <delete file="${itext.dist}/temp.tar" />
    </target>

    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <!-- Compiling the code                                               -->
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

    <target name="compile" depends="properties" description="--> compiles the core iText code">
        <mkdir dir="${itext.classes}" />
        <javac srcdir="${itext.src}" destdir="${itext.classes}"
            excludes="com/lowagie/servlets/*.java,com/lowagie/text/xml/*.java,com/lowagie/text/html/HtmlParser.java,com/lowagie/text/html/HtmlPeer.java,com/lowagie/text/html/HtmlTagMap.java,com/lowagie/text/html/SAXmyHtmlHandler.java">
            <classpath refid="classpath" />
        </javac>
    </target>

    <target name="compileWithXML" depends="properties" description="--> compiles iText completely">
        <mkdir dir="${itext.classes}" />
        <echo>Your path to j2ee.jar: ${j2ee.jar}</echo>
        <javac srcdir="${itext.src}" destdir="${itext.classes}">
            <classpath refid="classpath" />
        </javac>
    </target>

    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <!-- Jarring the code                                                 -->
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

    <target name="jar"  depends="properties,compile" description="--> makes a jarfile from the core iText code">
        <mkdir dir="${itext.dist}" />
        <mkdir dir="${itext.bin}" />
        <mkdir dir="${itext.classes}/com/lowagie/text/pdf/fonts" />
        <copy todir="${itext.classes}/com/lowagie/text/pdf/fonts" overwrite="yes">
            <fileset dir="${itext.src}/com/lowagie/text/pdf/fonts">
                <include name="**/*.afm"/>
            </fileset>
        </copy>
        <jar jarfile="${itext.dist}/iText.jar" basedir="${itext.classes}" excludes="**/com/lowagie/text/xml/*.class,**/HtmlPeer.class,**/HtmlParser.class,**/HtmlTagMap.class,**/SAXmyHtmlHandler.class" />
        <copy file="${itext.dist}/iText.jar" todir="${itext.bin}" overwrite="yes" />
    </target>

    <target name="jarWithXML" depends="compileWithXML" description="--> makes a jarfile from the complete iText code">
        <mkdir dir="${itext.dist}" />
        <mkdir dir="${itext.bin}" />
        <mkdir dir="${itext.classes}/com/lowagie/text/pdf/fonts" />
        <copy todir="${itext.classes}/com/lowagie/text/pdf/fonts" overwrite="yes">
            <fileset dir="${itext.src}/com/lowagie/text/pdf/fonts">
                <include name="**/*.afm"/>
            </fileset>
        </copy>
        <jar jarfile="${itext.dist}/iText.jar" basedir="${itext.classes}" excludes="**/com/lowagie/text/xml/*.class,**/HtmlPeer.class,**/HtmlParser.class,**/HtmlTagMap.class,**/SAXmyHtmlHandler.class" />
        <copy file="${itext.dist}/iText.jar" todir="${itext.bin}" overwrite="yes" />
        <jar jarfile="${itext.dist}/iTextXML.jar" basedir="${itext.classes}" includes="**/com/lowagie/text/xml/*.class,**/HtmlPeer.class,**/HtmlParser.class,**/HtmlTagMap.class,**/SAXmyHtmlHandler.class" />
        <copy file="${itext.dist}/iTextXML.jar" todir="${itext.bin}" overwrite="yes" />
        <jar jarfile="${itext.dist}/iTextAsian.jar" basedir="${itext.src}" includes="**/com/lowagie/text/pdf/fonts/*.cmap,**/com/lowagie/text/pdf/fonts/*.properties" />
        <jar jarfile="${itext.dist}/iTextAsianCmaps.jar" basedir="${itext.src}" includes="**/com/lowagie/text/pdf/fonts/cmaps/*" />
        <copy file="${itext.dist}/iTextAsian.jar" todir="${itext.bin}" overwrite="yes" />
        <copy file="${itext.dist}/iTextAsianCmaps.jar" todir="${itext.bin}" overwrite="yes" />
    </target>

    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <!-- Archiving the source                                              -->
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

    <target name="srczip" depends="properties" description="--> makes two zipfiles (1 with the core iText code and 1 with XML/RTF classes)">
        <mkdir dir="${itext.dist}" />
        <zip zipfile="${itext.dist}/src.zip" basedir="${itext.src}" includes="**/*.java, **/*.txt, **/*.afm" excludes="com/lowagie/servlets/*.java,com/lowagie/text/xml/*.java,com/lowagie/text/html/HtmlParser.java,com/lowagie/text/html/HtmlPeer.java,com/lowagie/text/html/HtmlTagMap.java,com/lowagie/text/html/SAXmyHtmlHandler.java" />
        <zip zipfile="${itext.dist}/srcXML.zip" basedir="${itext.src}" includes="com/lowagie/servlets/*.java,com/lowagie/text/xml/*.java,com/lowagie/text/html/HtmlParser.java,com/lowagie/text/html/HtmlPeer.java,com/lowagie/text/html/HtmlTagMap.java,com/lowagie/text/html/SAXmyHtmlHandler.java" />
    </target>

    <target name="srctargz" depends="properties" description="--> makes two tar.gz-files (1 with the core iText code and 1 with XML/RTF classes)">
        <mkdir dir="${itext.dist}" />
        <tar tarfile="${itext.dist}/classes.tar" basedir="${itext.classes}" />
        <tar tarfile="${itext.dist}/src.tar" basedir="${itext.src}" includes="**/*.java, **/*.txt, **/*.afm" excludes="com/lowagie/servlets/*.java,com/lowagie/text/xml/*.java,com/lowagie/text/html/HtmlParser.java,com/lowagie/text/html/HtmlPeer.java,com/lowagie/text/html/HtmlTagMap.java,com/lowagie/text/html/SAXmyHtmlHandler.java" />
        <tar tarfile="${itext.dist}/srcXML.tar" basedir="${itext.src}" includes="com/lowagie/servlets/*.java,com/lowagie/text/xml/*.java,com/lowagie/text/html/HtmlParser.java,com/lowagie/text/html/HtmlPeer.java,com/lowagie/text/html/HtmlTagMap.java,com/lowagie/text/html/SAXmyHtmlHandler.java" />
        <gzip zipfile="${itext.dist}/classes.tar.gz" src="${itext.dist}/classes.tar" />
        <gzip zipfile="${itext.dist}/src.tar.gz" src="${itext.dist}/src.tar" />
        <gzip zipfile="${itext.dist}/srcXML.tar.gz" src="${itext.dist}/srcXML.tar" />
        <delete file="${itext.dist}/classes.tar" />
        <delete file="${itext.dist}/src.tar" />
        <delete file="${itext.dist}/srcXML.tar" />
    </target>

    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <!-- Archiving the source                                              -->
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

    <target name="javadoc" depends="properties" description="--> generates the complete documentation with javadoc">
        <mkdir dir="${itext.docs}" />
        <javadoc packagenames="com.lowagie.tools.*,com.lowagie.servlets.*, com.lowagie.text.*, com.lowagie.text.pdf.*, com.lowagie.text.rtf.*, com.lowagie.text.pdf.afm.*, com.lowagie.text.pdf.hyphenation.*, com.lowagie.text.pdf.wmf.*, com.lowagie.text.html.*, com.lowagie.text.markup.*, com.lowagie.text.xml.*"
            sourcepath="${itext.src}"
            destdir="${itext.docs}"
            author="true"
            private="true">
            <link href="http://java.sun.com/j2se/1.3/docs/api/" />
        </javadoc>
    </target>

    <target name="docstargz" depends="properties,javadoc" description="--> makes a tar.gz-file with the complete javadoc documentation">
        <mkdir dir="${itext.dist}" />
        <tar tarfile="${itext.dist}/docs.tar" basedir="${itext.docs}" />
        <gzip zipfile="${itext.dist}/docs.tar.gz" src="${itext.dist}/docs.tar" />
        <delete file="${itext.dist}/docs.tar" />
    </target>

    <target name="tutorialtargz" depends="properties" description="--> makes several tar.gz-files with the tutorial, examples,...">
        <mkdir dir="${itext.dist}" />
        <tar tarfile="${itext.dist}/www.tar" basedir="${itext.www}" excludes="**/tutorial/*.*, **/examples/*.*" />
        <gzip zipfile="${itext.dist}/www.tar.gz" src="${itext.dist}/www.tar" />
        <delete file="${itext.dist}/www.tar" />
        <tar tarfile="${itext.dist}/tutorial.tar" basedir="${itext.tutorial}" />
        <gzip zipfile="${itext.dist}/tutorial.tar.gz" src="${itext.dist}/tutorial.tar" />
        <delete file="${itext.dist}/tutorial.tar" />
        <tar tarfile="${itext.dist}/examples.tar" basedir="${itext.examples}" excludes="**/*.class" />
        <gzip zipfile="${itext.dist}/examples.tar.gz" src="${itext.dist}/examples.tar" />
        <delete file="${itext.dist}/examples.tar" />
    </target>

    <target name="examples" depends="properties" description="--> executes (almost) all examples from the tutorial">
        <echo>Examples Chap0105.java, OutSimplePDF.java, Calendar.java and Month.java are NOT STANDALONE programs.</echo>
        <echo>They will not compile without a servlet library.</echo>
        <echo>Examples Chap0611.java and Chap0612.java require JAI.</echo>
        <echo>They will not compile without this extra library.</echo>
        <javac srcdir="${itext.examples}" destdir="${itext.examples}" verbose="false" deprecation="false" excludes="Chap0105.java, OutSimplePDF.java, Calendar.java, Month.java, Chap0611.java, Chap0612.java" >
           <classpath refid="classpath" />
        </javac>
        <java fork="yes" dir="${itext.examples}" classname="Chap0101">
           <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0102">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0103">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0104">
            <classpath refid="classpath" />
        </java>
        <echo>Chapter 1 example 5: this is a Servlet example!</echo>
        <java fork="yes" dir="${itext.examples}" classname="Chap0106">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0107">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0108">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0109">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0110">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0111">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0201">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0202">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0203">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0204">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0205">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0206">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0207">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0208">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap02_hyphenation">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0209">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0301">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0302">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0303">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0304">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0401">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0402">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0403">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0404">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0405">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0501">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0502">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0503">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0504">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0505">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0506">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0507">
            <classpath refid="classpath" />
	</java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0508">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0509">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0510">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0511">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0512">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0513">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0514">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0515">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0516">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0517">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0518">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0601">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0602">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0603">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0604">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0605">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0606">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0607">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0608">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0609">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0610">
            <classpath refid="classpath" />
        </java>
        <echo>Chapter 6 example 11: this example requires JAI</echo>
        <echo>Please compile and execute it seperately</echo>
        <echo>Chapter 6 example 12: this example requires JAI</echo>
        <echo>Please compile and execute it seperately</echo>
        <java fork="yes" dir="${itext.examples}" classname="Chap0613">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0614">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0615">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0616">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0701">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0702">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0703">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0704">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0705">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0706">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0707">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0708">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0801">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0802">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0803">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0804">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap0901">
            <classpath refid="classpath" />
        </java>
        <echo>Chapter 9 example 2: this example requires a correct filepath to comic.ttf</echo>
        <echo>Please compile and execute it seperately</echo>
        <echo>Chapter 9 example 3: this example requires a correct filepath to comic.ttf</echo>
        <echo>Please compile and execute it seperately</echo>
        <echo>Chapter 9 example 4: this example requires a correct filepath to msgothic.ttc</echo>
        <echo>Please compile and execute it seperately</echo>
        <java fork="yes" dir="${itext.examples}" classname="Chap0905">
            <classpath refid="classpath" />
        </java>
        <echo>Chapter 9 example 6: this example requires a correct filepath to some ttc's and ttf's</echo>
        <echo>Please compile and execute it seperately</echo>
        <java fork="yes" dir="${itext.examples}" classname="Chap0907">
            <classpath refid="classpath" />
        </java>
        <echo>Chapter 9 example 8: this example requires a correct filepath to some barcode ttf's</echo>
        <echo>Please compile and execute it seperately</echo>
        <java fork="yes" dir="${itext.examples}" classname="Chap0909">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1001">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1002">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1003">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1004">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1005">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1006">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1007">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1008">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1009">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1010">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1011">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1012">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1013">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1014">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1015">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap10_Graphics2D">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="iTextLogo">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1101">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1102">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1103">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1104">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1105">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1106">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1107">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1108">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1109">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1110">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1201">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1202">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap1203">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap13_form">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="Chap13_pdfreader">
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="com.lowagie.tools.concat_pdf">
            <arg value="Chap0101.pdf"/>
            <arg value="Chap0102.pdf"/>
            <arg value="Chap0103.pdf"/>
            <arg value="result.pdf"/>
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="com.lowagie.tools.split_pdf">
            <arg value="result.pdf"/>
            <arg value="result1.pdf"/>
            <arg value="result2.pdf"/>
            <arg value="2"/>
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="com.lowagie.tools.handout_pdf">
            <arg value="result.pdf"/>
            <arg value="handout.pdf"/>
            <arg value="2"/>
            <classpath refid="classpath" />
        </java>
        <java fork="yes" dir="${itext.examples}" classname="com.lowagie.tools.encrypt_pdf">
            <arg value="result.pdf"/>
            <arg value="encrypted.pdf"/>
            <arg value="user"/>
            <arg value="master"/>
            <arg value="00000000"/>
            <arg value="128"/>
            <classpath refid="classpath" />
        </java>
        <delete>
            <fileset dir="${itext.examples}" includes="**/*.class"/>
        </delete>
    </target>

    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <!-- Making a release                                                 -->
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

    <target name="release" depends="properties,jarWithXML, srczip, srctargz, docstargz, tutorialtargz" description="--> makes a complete iText release">
    </target>

    <target name="no.version.number" if="number.is.invalid">
        <fail message="You didn't enter a version number: ant -Dnumber=XXX release.sf" />
    </target>

    <target name="release.sf" depends="properties" description="--> makes a complete iText release ready to publish on SourceForge">
        <property name="number" value="${defaultnumber}" />
        <property name="number.is.${number}" value="true" />
        <antcall target="no.version.number" />
        <antcall target="release" />
        <mkdir dir="${itext.sf}" />
        <copy file="${itext.dist}/iText.jar" tofile="${itext.sf}/itext-${number}.jar" overwrite="yes" />
        <copy file="${itext.dist}/iTextXML.jar" tofile="${itext.sf}/itext-xml-${number}.jar" overwrite="yes" />
        <copy file="${itext.dist}/src.zip" tofile="${itext.sf}/itext-src-${number}.zip" overwrite="yes" />
        <copy file="${itext.dist}/srcXML.zip" tofile="${itext.sf}/itext-xml-src-${number}.zip" overwrite="yes" />
        <copy file="${itext.dist}/src.tar.gz" tofile="${itext.sf}/itext-src-${number}.tar.gz" overwrite="yes" />
        <copy file="${itext.dist}/srcXML.tar.gz" tofile="${itext.sf}/itext-xml-src-${number}.tar.gz" overwrite="yes" />
        <copy file="${itext.dist}/docs.tar.gz" tofile="${itext.sf}/itext-docs-${number}.tar.gz" overwrite="yes" />
        <copy file="${itext.dist}/tutorial.tar.gz" tofile="${itext.sf}/itext-tutorial-${number}.tar.gz" overwrite="yes" />
    </target>

    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <!-- Installing iText in one command                                  -->
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

    <target name="install" depends="properties,download.site, release, examples" description="--> installs iText in one command">
    </target>

    <target name="install.cvs" depends="properties,download.cvs, release, examples" description="--> installs the current version of iText in one command">
    </target>

</project>
