| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <?xml version="1.0"?>
- <!--
- This file is part of the DITA Open Toolkit project.
- See the accompanying license.txt file for applicable licenses.
- -->
- <project name="org.dita.pdf2.xep">
- <target name="transform.fo2pdf.xep.test-use">
- <condition property="use.xep.pdf.formatter">
- <equals arg1="${pdf.formatter}" arg2="xep"/>
- </condition>
- </target>
- <target name="transform.fo2pdf.xep.init" depends="transform.fo2pdf.xep.test-use" if="use.xep.pdf.formatter">
- <condition property="use.xep.pdf.formatter">
- <equals arg1="${pdf.formatter}" arg2="xep"/>
- </condition>
-
- <condition property="temp.transformation.file" value="${dita.plugin.org.dita.pdf2.xep.dir}/xsl/fo/topic2fo_shell_xep.xsl">
- <and>
- <not><isset property="args.xsl.pdf"/></not>
- <isset property="use.xep.pdf.formatter"/>
- </and>
- </condition>
-
- <!-- default output format -->
- <condition property="xep.formatter.output-format" value="PDF">
- <not><isset property="xep.formatter.output-format"/></not>
- </condition>
- <!-- output file extension -->
- <condition property="xsl.formatter.ext" value=".ps">
- <and>
- <equals arg1="${xep.formatter.output-format}" arg2="PostScript"/>
- <not><isset property="xsl.formatter.ext"/></not>
- </and>
- </condition>
- <condition property="xsl.formatter.ext" value=".html">
- <and>
- <equals arg1="${xep.formatter.output-format}" arg2="XHTML"/>
- <not><isset property="xsl.formatter.ext"/></not>
- </and>
- </condition>
- <condition property="xsl.formatter.ext" value=".AT.xml">
- <and>
- <equals arg1="${xep.formatter.output-format}" arg2="XEP"/>
- <not><isset property="xsl.formatter.ext"/></not>
- </and>
- </condition>
- <!--condition property="xsl.formatter.ext" value=".AT.xml">
- <and>
- <equals arg1="${xep.formatter.output-format}" arg2="AT"/>
- <not><isset property="xsl.formatter.ext"/></not>
- </and>
- </condition-->
- <condition property="xsl.formatter.ext" value=".svg">
- <and>
- <equals arg1="${xep.formatter.output-format}" arg2="SVG"/>
- <not><isset property="xsl.formatter.ext"/></not>
- </and>
- </condition>
- <condition property="xsl.formatter.ext" value=".xps">
- <and>
- <equals arg1="${xep.formatter.output-format}" arg2="XPS"/>
- <not><isset property="xsl.formatter.ext"/></not>
- </and>
- </condition>
- <condition property="xsl.formatter.ext" value=".afp">
- <and>
- <equals arg1="${xep.formatter.output-format}" arg2="AFP"/>
- <not><isset property="xsl.formatter.ext"/></not>
- </and>
- </condition>
- <condition property="xsl.formatter.ext" value=".ppml">
- <and>
- <equals arg1="${xep.formatter.output-format}" arg2="PPML"/>
- <not><isset property="xsl.formatter.ext"/></not>
- </and>
- </condition>
- <condition property="xsl.formatter.ext" value=".pdf">
- <and>
- <equals arg1="${xep.formatter.output-format}" arg2="PDF"/>
- <not><isset property="xsl.formatter.ext"/></not>
- </and>
- </condition>
- </target>
- <!-- run XEP -->
- <target name="transform.fo2pdf.xep" if="use.xep.pdf.formatter">
- <property name="xep.dir" value="${dita.plugin.org.dita.pdf2.xep.dir}/lib/xep"/>
-
- <condition property="xep.config.file" value="${custom.xep.config}">
- <isset property="custom.xep.config"/>
- </condition>
- <condition property="xep.config.file" value="${xep.dir}/xep.xml">
- <not><isset property="custom.xep.config"/></not>
- </condition>
-
- <path id="xep.class.path">
- <fileset dir="${lib.dir}" includes="**/*.jar"/>
- <fileset dir="${xep.dir}/lib" includes="**/*.jar"/>
- <pathelement location="${fo.lib.dir}/fo.jar"/>
- <pathelement location="${dita.plugin.org.dita.pdf2.xep.dir}/lib/xep.jar"/>
- </path>
- <condition property="xep.failOnError" value="false">
- <not><isset property="xep.failOnError"/></not>
- </condition>
-
- <condition property="outputFile" value="${dita.map.output.dir}/${outputFile.base}${xsl.formatter.ext}">
- <not><isset property="outputFile"/></not>
- </condition>
- <mkdir dir="${dita.map.output.dir}"/>
-
- <echo level="info" taskname="xep">Processing ${pdf2.temp.dir}/topic.fo to ${outputFile}</echo>
- <java classname="com.idiominc.ws.opentopic.fo.xep.Runner" resultproperty="errCode"
- failonerror="${xep.failOnError}" fork="true" maxmemory="${maxJavaMemory}" taskname="xep">
- <jvmarg line="${baseJVMArgLine}"/>
- <arg value="${pdf2.temp.dir}/topic.fo"/>
- <arg value="${outputFile}"/>
- <arg value="failOnError=${xep.failOnError}"/>
- <arg value="-${xep.formatter.output-format}"/>
- <classpath refid="xep.class.path"/>
- <sysproperty key="com.renderx.xep.CONFIG" value="${xep.config.file}"/>
- <!--Set up catalog resolver with the DITA main catalog file, useful for solving for example SVG image DOCTYPES-->
- <sysproperty key="com.renderx.sax.entityresolver" value="org.apache.xml.resolver.tools.CatalogResolver"/>
- <sysproperty key="xml.catalog.files" value="${dita.dir}/catalog-dita.xml"/>
- </java>
- <condition property="xepExitedOnError" value="true">
- <not><equals arg1="${errCode}" arg2="0"/></not>
- </condition>
- </target>
- </project>
|