1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <!-- This file is part of the DITA Open Toolkit project hosted on
|
---|
3 | Sourceforge.net. See the accompanying license.txt file for
|
---|
4 | applicable licenses.-->
|
---|
5 | <!-- (c) Copyright IBM Corp. 2006 All Rights Reserved. -->
|
---|
6 | <project name="dita2legacypdf" default="dita2legacypdf">
|
---|
7 |
|
---|
8 | <target name="dita2legacypdf"
|
---|
9 | depends="build-init, topic2legacypdf.init, preprocess, map2legacypdf, topic2legacypdf">
|
---|
10 | </target>
|
---|
11 |
|
---|
12 | <target name="topic2legacypdf.init">
|
---|
13 | <available classname="org.apache.fop.tools.anttasks.Fop" property="hasFOP">
|
---|
14 | <classpath>
|
---|
15 | <pathelement location="${dita.dir}/demo/legacypdf/lib/fop.jar"/>
|
---|
16 | </classpath>
|
---|
17 | </available>
|
---|
18 | <!-- append a '.' to ${fo.img.ext} if ${args.fo.img.ext} not contains '.' -->
|
---|
19 | <condition property="fo.img.ext" value=".${args.fo.img.ext}">
|
---|
20 | <and>
|
---|
21 | <isset property="args.fo.img.ext" />
|
---|
22 | <not>
|
---|
23 | <contains string="${args.fo.img.ext}" substring="." />
|
---|
24 | </not>
|
---|
25 | </and>
|
---|
26 | </condition>
|
---|
27 | <condition property="fo.img.ext" value="${args.fo.img.ext}">
|
---|
28 | <and>
|
---|
29 | <isset property="args.fo.img.ext" />
|
---|
30 | <contains string="${args.fo.img.ext}" substring="." />
|
---|
31 | </and>
|
---|
32 | </condition>
|
---|
33 | </target>
|
---|
34 |
|
---|
35 | <target name="topic2legacypdf" if="noMap">
|
---|
36 | <antcall target="dita.topic.fo">
|
---|
37 | <param name="input"
|
---|
38 | value="${dita.temp.dir}${file.separator}${user.input.file}" />
|
---|
39 | <param name="output"
|
---|
40 | value="${dita.map.output.dir}${file.separator}${dita.topic.filename.root}.fo" />
|
---|
41 | </antcall>
|
---|
42 | <antcall target="dita.fo2pdf">
|
---|
43 | <param name="input"
|
---|
44 | value="${dita.map.output.dir}${file.separator}${dita.topic.filename.root}.fo" />
|
---|
45 | <param name="output"
|
---|
46 | value="${dita.map.output.dir}${file.separator}${dita.topic.filename.root}.pdf" />
|
---|
47 | </antcall>
|
---|
48 | </target>
|
---|
49 |
|
---|
50 | <target name="map2legacypdf" unless="noMap">
|
---|
51 | <antcall target="dita.map.fo">
|
---|
52 | <param name="input"
|
---|
53 | value="${dita.temp.dir}${file.separator}${user.input.file}" />
|
---|
54 | <param name="output"
|
---|
55 | value="${dita.map.output.dir}${file.separator}${dita.map.filename.root}.fo" />
|
---|
56 | </antcall>
|
---|
57 | <antcall target="dita.fo2pdf">
|
---|
58 | <param name="input"
|
---|
59 | value="${dita.map.output.dir}${file.separator}${dita.map.filename.root}.fo" />
|
---|
60 | <param name="output"
|
---|
61 | value="${dita.map.output.dir}${file.separator}${dita.map.filename.root}.pdf" />
|
---|
62 | </antcall>
|
---|
63 | </target>
|
---|
64 |
|
---|
65 | <!-- Build XSL-FO output from ditamap -->
|
---|
66 | <target name="dita.map.fo"
|
---|
67 | description="Build XSL-FO output from ditamap">
|
---|
68 | <condition property="args.xsl"
|
---|
69 | value="${dita.plugin.org.dita.legacypdf.dir}${file.separator}dita2fo-shell.xsl">
|
---|
70 | <not>
|
---|
71 | <isset property="args.xsl" />
|
---|
72 | </not>
|
---|
73 | </condition>
|
---|
74 | <dirname file="${dita.temp.dir}${file.separator}${user.input.file}"
|
---|
75 | property="dita.merged.dir" />
|
---|
76 | <xslt in="${input}"
|
---|
77 | out="${dita.merged.dir}${file.separator}${dita.map.filename.root}_MERGED.xml"
|
---|
78 | style="${dita.plugin.org.dita.legacypdf.dir}${file.separator}xslfo${file.separator}topicmerge.xsl">
|
---|
79 | <!--<xmlcatalog refid="dita.catalog" />-->
|
---|
80 | </xslt>
|
---|
81 | <xslt
|
---|
82 | in="${dita.merged.dir}${file.separator}${dita.map.filename.root}_MERGED.xml"
|
---|
83 | out="${output}" style="${args.xsl}">
|
---|
84 | <!--<xmlcatalog refid="dita.catalog" />-->
|
---|
85 | <param name="output-related-links"
|
---|
86 | expression="${args.fo.output.rel.links}"
|
---|
87 | if="args.fo.output.rel.links" />
|
---|
88 | <param name="DITAEXT" expression="${dita.ext}" if="dita.ext" />
|
---|
89 | <param name="DRAFT" expression="${args.draft}" if="args.draft" />
|
---|
90 | <param name="ARTLBL" expression="${args.artlbl}" if="args.artlbl" />
|
---|
91 | <param name="dflt-ext" expression="${fo.img.ext}" if="fo.img.ext" />
|
---|
92 | </xslt>
|
---|
93 | </target>
|
---|
94 |
|
---|
95 | <!-- Build PDF from FO using FOP, need to include FOP, Avalon,
|
---|
96 | and Batik relevant jar files in CLASSPATH -->
|
---|
97 | <target name="dita.fo2pdf" if="hasFOP"
|
---|
98 | description="Build PDF from FO using FOP">
|
---|
99 | <taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop" >
|
---|
100 | <classpath>
|
---|
101 | <fileset dir="${dita.plugin.org.dita.legacypdf.dir}/lib">
|
---|
102 | <include name="*.jar"/>
|
---|
103 | </fileset>
|
---|
104 | <fileset dir="${dita.dir}/lib">
|
---|
105 | <include name="*.jar"/>
|
---|
106 | </fileset>
|
---|
107 | </classpath>
|
---|
108 | </taskdef>
|
---|
109 | <antcall target="dita.fo2pdf.userconfig" />
|
---|
110 | <antcall target="dita.fo2pdf.nouserconfig" />
|
---|
111 | </target>
|
---|
112 |
|
---|
113 | <target name="dita.fo2pdf.userconfig" if="args.fo.userconfig">
|
---|
114 | <fop format="application/pdf" basedir="${input}" fofile="${input}"
|
---|
115 | outfile="${output}" messagelevel="info"
|
---|
116 | userconfig="${args.fo.userconfig}">
|
---|
117 | </fop>
|
---|
118 | </target>
|
---|
119 |
|
---|
120 | <target name="dita.fo2pdf.nouserconfig" unless="args.fo.userconfig">
|
---|
121 | <fop format="application/pdf" basedir="${input}" fofile="${input}"
|
---|
122 | outfile="${output}" messagelevel="info">
|
---|
123 | </fop>
|
---|
124 | </target>
|
---|
125 |
|
---|
126 | <!-- Build XSL-FO output from dita topic -->
|
---|
127 | <target name="dita.topic.fo"
|
---|
128 | description="Build XSL-FO output from dita topic">
|
---|
129 | <condition property="args.xsl"
|
---|
130 | value="${dita.plugin.org.dita.legacypdf.dir}${file.separator}dita2fo-shell.xsl">
|
---|
131 | <not>
|
---|
132 | <isset property="args.xsl" />
|
---|
133 | </not>
|
---|
134 | </condition>
|
---|
135 | <xslt in="${input}" out="${output}"
|
---|
136 | style="${args.xsl}">
|
---|
137 | <!--<xmlcatalog refid="dita.catalog" />-->
|
---|
138 | <param name="output-related-links"
|
---|
139 | expression="${args.fo.output.rel.links}"
|
---|
140 | if="args.fo.output.rel.links" />
|
---|
141 | <param name="DITAEXT" expression="${dita.ext}" if="dita.ext" />
|
---|
142 | <param name="DRAFT" expression="${args.draft}" if="args.draft" />
|
---|
143 | <param name="ARTLBL" expression="${args.artlbl}" if="args.artlbl" />
|
---|
144 | <param name="dflt-ext" expression="${fo.img.ext}" if="fo.img.ext" />
|
---|
145 | </xslt>
|
---|
146 | </target>
|
---|
147 |
|
---|
148 | </project>
|
---|