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.

configuration.xml 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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>Apache FOP: Configuration</title>
  19. <version>$Revision$</version>
  20. </header>
  21. <body>
  22. <section id="general">
  23. <title>Configuration File Basics</title>
  24. <p>
  25. The FOP configuration file is an XML file containing a variety of settings that are useful
  26. for controlling FOP's behavior, and for helping it find resources that you wish it to use.
  27. </p>
  28. <p>
  29. The easiest way to get started using a FOP configuration file is to copy the sample found
  30. at <code>{fop-dir}/conf/fop.xconf</code> to a location of your choice, and then to
  31. edit it according to your needs.
  32. It contains templates for the various configuration options, most of which are commented
  33. out. Remove the comments and change the settings for entries that you wish to use.
  34. Be sure to follow any instructions, including comments which specify the value range.
  35. Also, since the configuration file is XML, be sure to keep it well-formed.
  36. </p>
  37. <section id="general-available">
  38. <title>Making Configuration Available to FOP</title>
  39. <p>After creating your configuration file, you must tell FOP how to find it:</p>
  40. <ul>
  41. <li>
  42. If running FOP from the command-line, see the "-c" command-line option in
  43. <a href="running.html">Running FOP</a>.
  44. </li>
  45. <li>
  46. If running FOP as an embedded application, see
  47. <a href="embedding.html#config-external">Embedding, Using a Configuration File</a>.
  48. </li>
  49. </ul>
  50. <p>
  51. See <a href="embedding.html#config-internal">Setting the Configuration Programmatically</a>
  52. for instructions on how to do so in an embedded environment.
  53. </p>
  54. </section>
  55. </section>
  56. <section id="general-elements">
  57. <title>Summary of the General Configuration Options</title>
  58. <table>
  59. <tr>
  60. <th>Element</th>
  61. <th>Data Type (for the value)</th>
  62. <th>Default Value</th>
  63. </tr>
  64. <tr>
  65. <td>base</td>
  66. <td>URL</td>
  67. <td>Specifies the base URL based on which relative URL will be resolved.</td>
  68. </tr>
  69. <tr>
  70. <td>source-resolution</td>
  71. <td>Integer, dpi</td>
  72. <td>
  73. Resolution in dpi (dots per inch) which is used internally to determine the pixel
  74. size for SVG images and bitmap images without resolution information.
  75. </td>
  76. </tr>
  77. <tr>
  78. <td>target-resolution</td>
  79. <td>Integer, dpi</td>
  80. <td>
  81. Resolution in dpi (dots per inch) used to specify the output resolution for bitmap
  82. images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps
  83. generated by Apache Batik for filter effects and such.
  84. </td>
  85. </tr>
  86. <tr>
  87. <td>strict-validation</td>
  88. <td>Boolean (true, false)</td>
  89. <td>
  90. Setting this option to 'false' causes FOP to be more forgiving about XSL-FO validity,
  91. for example, you're allowed to specify a border on a region-body which is supported
  92. by some FO implementations but is non-standard. Note that such a border would
  93. currently have no effect in Apache FOP.</td>
  94. </tr>
  95. <tr>
  96. <td>break-indent-inheritance</td>
  97. <td>Boolean (true, false)</td>
  98. <td>
  99. Setting this option to 'true' causes FOP to use an alternative rule set to determine
  100. text indents specified through margins, start-indent and end-indent. Many commercial
  101. FO implementations have chosen to break the XSL specification in this aspect. This
  102. option tries to mimic their behaviour. Please note that Apache FOP may still not
  103. behave exactly like those implementations either because FOP has not fully matched
  104. the desired behaviour and because the behaviour among the commercial implementations
  105. varies. The default for this option (i.e. false) is to behave exactly like the
  106. specification describes.</td>
  107. </tr>
  108. <tr>
  109. <td>default-page-settings</td>
  110. <td>n/a</td>
  111. <td>
  112. Specifies the default width and height of a page if "auto" is specified
  113. for either or both values. Use "height" and "width" attributes on the
  114. default-page-settings element to specify the two values.</td>
  115. </tr>
  116. <tr>
  117. <td>renderers</td>
  118. <td>(see text below)</td>
  119. <td>Contains the configuration for each renderer. See below.</td>
  120. </tr>
  121. </table>
  122. <p>
  123. This is an excerpt from the example configuration file coming with FOP:
  124. </p>
  125. <source><![CDATA[
  126. <fop version="1.0">
  127. <!-- Base URL for resolving relative URLs -->
  128. <base>./</base>
  129. <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
  130. <source-resolution>72</source-resolution>
  131. <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
  132. <target-resolution>72</target-resolution>
  133. <!-- default page-height and page-width, in case
  134. value is specified as auto -->
  135. <default-page-settings height="11in" width="8.26in"/>
  136. <!-- etc. etc..... -->
  137. </fop>]]></source>
  138. </section>
  139. <section id="renderers">
  140. <title>Renderer configuration</title>
  141. <p>
  142. Each Renderer has its own configuration section which is identified by the
  143. MIME type the Renderer is written for, ex. "application/pdf" for the PDF Renderer.
  144. </p>
  145. <p>
  146. The configuration for the PDF Renderer could look like this:
  147. </p>
  148. <source><![CDATA[
  149. <renderers>
  150. <renderer mime="application/pdf">
  151. <filterList>
  152. <!-- provides compression using zlib flate (default is on) -->
  153. <value>flate</value>
  154. </filterList>
  155. <fonts>
  156. <font metrics-url="arial.xml" kerning="yes" embed-url="arial.ttf">
  157. <font-triplet name="Arial" style="normal" weight="normal"/>
  158. <font-triplet name="ArialMT" style="normal" weight="normal"/>
  159. </font>
  160. <font metrics-url="arialb.xml" kerning="yes" embed-url="arialb.ttf">
  161. <font-triplet name="Arial" style="normal" weight="bold"/>
  162. <font-triplet name="ArialMT" style="normal" weight="bold"/>
  163. </font>
  164. </fonts>
  165. </renderer>
  166. <renderer mime="application/postscript">
  167. <!-- etc. etc..... -->]]></source>
  168. <p>
  169. The details on the font configuration can be found on the separate <a href="fonts.html">Fonts</a> page.
  170. Note especially the section entitled <a href="fonts.html#register">Register Fonts with FOP</a>.
  171. </p>
  172. </section>
  173. </body>
  174. </document>