You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

running.xml 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <?xml version="1.0" standalone="no"?>
  2. <!--
  3. Copyright 1999-2005 The Apache Software Foundation
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. -->
  14. <!-- $Id$ -->
  15. <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
  16. <document>
  17. <header>
  18. <title>Running Apache FOP</title>
  19. <version>$Revision$</version>
  20. </header>
  21. <body>
  22. <section id="require">
  23. <title>System Requirements</title>
  24. <p>The following software must be installed:</p>
  25. <ul>
  26. <li>Java 1.3.x or later Runtime Environment.</li>
  27. <li>
  28. Apache FOP. The <a href="../download.html">FOP distribution</a> includes all libraries that you will
  29. need to run a basic FOP installation. These can be found in the [fop-root]/lib directory. These
  30. libraries include the following:
  31. <ul>
  32. <li>
  33. A JAXP-compatible XML Parser (FOP comes with <a class="fork" href="ext:xerces">Apache Xerces-J</a>).
  34. </li>
  35. <li>
  36. A JAXP-compatible XSLT Processor (FOP comes with <a class="fork" href="ext:xalan">Apache Xalan-J</a>).
  37. </li>
  38. <li><a class="fork" href="ext:batik">Apache Batik</a>, an SVG library.</li>
  39. <li><a class="fork" href="ext:jakarta/commons/logging">Apache Jakarta Commons Logging</a>, a logger abstraction kit.</li>
  40. <li><a class="fork" href="ext:jakarta/commons/io">Apache Jakarta Commons IO</a>, a library with I/O utilities.</li>
  41. <li><a class="fork" href="ext:excalibur/framework">Apache Excalibur/Avalon Framework</a>, for XML configuration handling.</li>
  42. </ul>
  43. </li>
  44. </ul>
  45. <p>The following software is optional, depending on your needs:</p>
  46. <ul>
  47. <li>
  48. Graphics libraries. Support for some graphics formats requires additional packages. See
  49. <a href="graphics.html">FOP: Graphics Formats</a> for details.
  50. </li>
  51. <li>
  52. PDF encryption. See <a href="pdfencryption.html">FOP: PDF Encryption</a> for details.
  53. </li>
  54. </ul>
  55. <p>In addition, the following system requirements apply:</p>
  56. <ul>
  57. <li>
  58. If you will be using FOP to process SVG, you must do so in a graphical environment.
  59. See <a href="graphics.html#batik">FOP: Graphics (Batik)</a> for details.
  60. </li>
  61. </ul>
  62. </section>
  63. <section id="install">
  64. <title>Installation</title>
  65. <section id="install-instruct">
  66. <title>Instructions</title>
  67. <p>
  68. Basic FOP installation consists of first unzipping the <code>.gz</code> file that is the
  69. distribution medium, then unarchiving the resulting <code>.tar</code> file in a
  70. directory/folder that is convenient on your system. Please consult your operating system
  71. documentation or Zip application software documentation for instructions specific to your
  72. site.
  73. </p>
  74. </section>
  75. <section id="install-problems">
  76. <title>Problems</title>
  77. <p>
  78. Some Mac OSX users have experienced filename truncation problems using Stuffit to unzip
  79. and unarchive their distribution media. This is a legacy of older Mac operating systems,
  80. which had a 31-character pathname limit. Several Mac OSX users have recommended that
  81. Mac OSX users use the shell command <code>tar -xzf</code> instead.
  82. </p>
  83. </section>
  84. </section>
  85. <section id="standalone-start">
  86. <title>Starting FOP as a Standalone Application</title>
  87. <p>
  88. The usual and recommended practice for starting FOP from the command line is to run the
  89. batch file fop.bat (Windows) or the shell script fop (Unix/Linux).
  90. If you write your own scripts, be sure to review these standard scripts to make sure that
  91. you get your environment properly configured.
  92. </p>
  93. <p>
  94. The standard scripts for starting FOP require that the environment variable JAVA_HOME be
  95. set to a path pointing to the appropriate Java installation on your system. Macintosh OSX
  96. includes a Java environment as part of its distribution. We are told by Mac OSX users that
  97. the path to use in this case is <code>/Library/Java/Home</code>. <strong>Caveat:</strong>
  98. We suspect that, as Apple releases new Java environments and as FOP upgrades the minimum
  99. Java requirements, the two will inevitably not match on some systems. Please see
  100. <a href="http://developer.apple.com/java/faq">Java on Mac OSX FAQ</a> for information as
  101. it becomes available.
  102. </p>
  103. <p>
  104. As an alternative to the start scripts you can run "java -jar build/fop.jar" in which case
  105. FOP tries to build the classpath for running FOP dynamically. Please note, that this might
  106. not always work as expected.
  107. </p>
  108. <source><![CDATA[
  109. USAGE
  110. Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl|-ps|-txt|-at|-print] <outfile>
  111. [OPTIONS]
  112. -d debug mode
  113. -x dump configuration settings
  114. -q quiet mode
  115. -c cfg.xml use additional configuration file cfg.xml
  116. -l lang the language to use for user information
  117. -r relaxed/less strict validation (where available)
  118. -dpi xxx target resolution in dots per inch (dpi) where xxx is a number
  119. -s for area tree XML, down to block areas only
  120. -v to show FOP version being used
  121. [INPUT]
  122. infile xsl:fo input file (the same as the next)
  123. -fo infile xsl:fo input file
  124. -xml infile xml input file, must be used together with -xsl
  125. -xsl stylesheet xslt stylesheet
  126. -param name value <value> to use for parameter <name> in xslt stylesheet
  127. (repeat '-param name value' for each parameter)
  128. [OUTPUT]
  129. outfile input will be rendered as pdf file into outfile
  130. -pdf outfile input will be rendered as pdf file (outfile req'd)
  131. -awt input will be displayed on screen
  132. -mif outfile input will be rendered as mif file (outfile req'd)
  133. -rtf outfile input will be rendered as rtf file (outfile req'd)
  134. -tiff outfile input will be rendered as tiff file (outfile req'd)
  135. -png outfile input will be rendered as png file (outfile req'd)
  136. -pcl outfile input will be rendered as pcl file (outfile req'd)
  137. -ps outfile input will be rendered as PostScript file (outfile req'd)
  138. -txt outfile input will be rendered as text file (outfile req'd)
  139. -svg outfile input will be rendered as an svg slides file (outfile req'd)
  140. -at outfile representation of area tree as XML (outfile req'd)
  141. -print input file will be rendered and sent to the printer
  142. see options with "-print help"
  143. -out mime outfile input will be rendered using the given MIME type
  144. (outfile req'd) Example: "-out application/pdf D:\out.pdf"
  145. (Tip: "-out list" prints the list of supported MIME types)
  146. -foout outfile input will only be XSL transformed. The intermediate
  147. XSL-FO file is saved and no rendering is performed.
  148. (Only available if you use -xml and -xsl parameters)
  149. [Examples]
  150. Fop foo.fo foo.pdf
  151. Fop -fo foo.fo -pdf foo.pdf (does the same as the previous line)
  152. Fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf
  153. Fop -xml foo.xml -xsl foo.xsl -foout foo.fo
  154. Fop foo.fo -mif foo.mif
  155. Fop foo.fo -rtf foo.rtf
  156. Fop foo.fo -print or Fop -print foo.fo
  157. Fop foo.fo -awt]]></source>
  158. <p>
  159. PDF encryption is only available if FOP was compiled with encryption support
  160. <strong>and</strong> if compatible encryption support is availabe at run time.
  161. Currently, only the JCE is supported. Check the <a href="pdfencryption.html">Details</a>.
  162. </p>
  163. </section>
  164. <section id="check-input">
  165. <title>Using Xalan to Check XSL-FO Input</title>
  166. <p>
  167. FOP sessions that use -xml and -xsl input instead of -fo input are actually
  168. controlling two distinct conversions: Tranforming XML to XSL-FO, then formatting
  169. the XSL-FO to PDF (or another FOP output format).
  170. Although FOP controls both of these processes, the first is included merely as
  171. a convenience and for performance reasons.
  172. Only the second is part of FOP's core processing.
  173. If a user has a problem running FOP, it is important to determine which of these
  174. two processes is causing the problem.
  175. If the problem is in the first process, the user's stylesheet is likely the cause.
  176. The FOP development team does not have resources to help with stylesheet issues,
  177. although we have included links to some useful
  178. <a href="../resources.html#specs">Specifications</a> and
  179. <a href="../resources.html#articles">Books/Articles</a>.
  180. If the problem is in the second process, FOP may have a bug or an unimplemented
  181. feature that does require attention from the FOP development team.
  182. </p>
  183. <note>The user is always responsible to provide correct XSL-FO code to FOP.</note>
  184. <p>
  185. In the case of using -xml and -xsl input, although the user is responsible for
  186. the XSL-FO code that is FOP's input, it is not visible to the user. To make the
  187. intermediate FO file visible, the FOP distribution includes the "-foout" option
  188. which causes FOP to run only the first (transformation) step, and write the
  189. results to a file. (See also the Xalan command-line below)
  190. </p>
  191. <note>
  192. When asking for help on the FOP mailing lists, <em>never</em> attach XML and
  193. XSL to illustrate the issue. Always run the XSLT step (-foout) and send the
  194. resulting XSL-FO file instead. Of course, be sure that the XSL-FO file is
  195. correct before sending it.
  196. </note>
  197. <p>
  198. The -foout option works the same way as if you would call the
  199. <a href="http://xml.apache.org/xalan-j/commandline.html">Xalan command-line</a>:
  200. </p>
  201. <p>
  202. <code>java org.apache.xalan.xslt.Process -IN xmlfile -XSL file -OUT outfile</code>
  203. </p>
  204. <p>
  205. Note that there are some subtle differences between the FOP and Xalan command-lines.
  206. </p>
  207. </section>
  208. <section id="memory">
  209. <title>Memory Usage</title>
  210. <p>
  211. FOP can consume quite a bit of memory, even though this has been continually improved.
  212. This is partly inherent to the formatting process and partly caused by implementation choices.
  213. All FO processors currently on the market have memory problems with certain layouts.
  214. </p>
  215. <p>
  216. If you are running out of memory when using FOP, here are some ideas that may help:
  217. </p>
  218. <ul>
  219. <li>
  220. Increase memory available to the JVM. See
  221. <a href="http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/java.html">the -Xmx option</a>
  222. for more information.
  223. <warning>
  224. It is usually unwise to increase the memory allocated to the JVM beyond the amount of
  225. physical RAM, as this will generally cause significantly slower performance.
  226. </warning>
  227. </li>
  228. <li>
  229. Avoid forward references.
  230. Forward references are references to some later part of a document.
  231. Examples include page number citations which refer to pages which follow the citation,
  232. tables of contents at the beginning of a document, and page numbering schemes that
  233. include the total number of pages in the document
  234. (<a href="../faq.html#pagenum">"page N of TOTAL"</a>).
  235. Forward references cause all subsequent pages to be held in memory until the reference
  236. can be resolved, i.e. until the page with the referenced element is encountered.
  237. Forward references may be required by the task, but if you are getting a memory
  238. overflow, at least consider the possibility of eliminating them.
  239. A table of contents could be replaced by PDF bookmarks instead or moved to the end of
  240. the document (reshuffle the paper could after printing).
  241. </li>
  242. <li>
  243. Avoid large images, especially if they are scaled down.
  244. If they need to be scaled, scale them in another application upstream from FOP.
  245. For many image formats, memory consumption is driven mainly by the size of the image
  246. file itself, not its dimensions (width*height), so increasing the compression rate
  247. may help.
  248. </li>
  249. <li>
  250. Use multiple page sequences.
  251. FOP starts rendering after the end of a page sequence is encountered.
  252. While the actual rendering is done page-by-page, some additional memory is
  253. freed after the page sequence has been rendered.
  254. This can be substantial if the page sequence contains lots of FO elements.
  255. </li>
  256. </ul>
  257. <p>
  258. One of FOP's stated design goals is to be able to process input of arbitrary size.
  259. Addressing this goal is one of the prime motivations behind the
  260. <a href="../dev/index.html">FOP Redesign</a>.
  261. </p>
  262. </section>
  263. <section id="problems">
  264. <title>Problems</title>
  265. <p>If you have problems running FOP, please see the <a href="../gethelp.html">"How to get Help" page</a>.</p>
  266. </section>
  267. </body>
  268. </document>