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.

graphics.xml 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- $Id$ -->
  17. <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
  18. <document>
  19. <header>
  20. <title>Apache™ FOP: Graphics Formats</title>
  21. <version>$Revision$</version>
  22. </header>
  23. <body>
  24. <section id="introduction">
  25. <title>Introduction</title>
  26. <p>
  27. Some noteworthy features of the image handling subsystem are:
  28. </p>
  29. <ul>
  30. <li>
  31. The image libraries Jimi and JAI are not supported. Instead, Apache™ FOP uses the
  32. Image I/O API that was introduced with Java 1.4 for all bitmap codecs.
  33. </li>
  34. <li>
  35. Some bitmap images are not converted to a standardized 24 bit RGB image but are
  36. instead handled in their native format.
  37. </li>
  38. <li>
  39. A plug-in mechanism offers a possibility to add support for new formats without changing
  40. the FOP's source code.
  41. </li>
  42. </ul>
  43. <p>
  44. The actual <a href="http://xmlgraphics.apache.org/commons/image-loader.html">image loading framework</a>
  45. does not reside in Apache FOP, but in
  46. <a href="ext:xmlgraphics.apache.org/commons/">XML Graphics Commons</a>.
  47. </p>
  48. </section>
  49. <section id="support-overview">
  50. <title>Overview of Graphics Support</title>
  51. <p>
  52. The table below summarizes the <em>theoretical</em> support for graphical formats
  53. within FOP. In other words, within the constraints of the limitations listed here,
  54. these formats <em>should</em> work. However, many of them have not been tested,
  55. and there may be limitations that have not yet been discovered or documented.
  56. The packages needed to support some formats are not included in the FOP distribution
  57. and must be installed separately. Follow the links in the "Support Through" columns
  58. for more details.
  59. </p>
  60. <table>
  61. <tr>
  62. <th rowspan="2">Format</th>
  63. <th rowspan="2">Type</th>
  64. <th colspan="3">Support Through</th>
  65. </tr>
  66. <tr>
  67. <th><a href="#native">Apache FOP (native)</a></th>
  68. <th><a href="#batik">Apache Batik</a></th>
  69. <th><a href="#imageio">Image I/O</a></th>
  70. </tr>
  71. <tr>
  72. <td><a href="#bmp">BMP</a> (Microsoft Windows Bitmap)</td>
  73. <td>bitmap</td>
  74. <td/>
  75. <td/>
  76. <td>X [1]</td>
  77. </tr>
  78. <tr>
  79. <td><a href="#emf">EMF</a> (Windows Enhanced Metafile)</td>
  80. <td>vector (with embedded bitmaps)</td>
  81. <td>(X)</td>
  82. <td/>
  83. <td/>
  84. </tr>
  85. <tr>
  86. <td><a href="#eps">EPS</a> (Encapsulated PostScript)</td>
  87. <td>metafile (both bitmap and vector), most frequently used for vector drawings</td>
  88. <td>(X)</td>
  89. <td/>
  90. <td/>
  91. </tr>
  92. <tr>
  93. <td>GIF (Graphics Interchange Format)</td>
  94. <td>bitmap</td>
  95. <td/>
  96. <td/>
  97. <td>X</td>
  98. </tr>
  99. <tr>
  100. <td><a href="#jpeg">JPEG</a> (Joint Photographic Experts Group)</td>
  101. <td>bitmap</td>
  102. <td>(X)</td>
  103. <td/>
  104. <td>X</td>
  105. </tr>
  106. <tr>
  107. <td><a href="#png">PNG</a> (Portable Network Graphic)</td>
  108. <td>bitmap</td>
  109. <td/>
  110. <td/>
  111. <td>X</td>
  112. </tr>
  113. <tr>
  114. <td><a href="#svg">SVG</a> (Scalable Vector Graphics)</td>
  115. <td>vector (with embedded bitmaps)</td>
  116. <td/>
  117. <td>X</td>
  118. <td/>
  119. </tr>
  120. <tr>
  121. <td><a href="#tiff">TIFF</a> (Tag Image Format File)</td>
  122. <td>bitmap</td>
  123. <td>(X)</td>
  124. <td/>
  125. <td>X [1]</td>
  126. </tr>
  127. <tr>
  128. <td><a href="#wmf">WMF</a> (Windows Metafile)</td>
  129. <td>vector (with embedded bitmaps)</td>
  130. <td/>
  131. <td>(X)</td>
  132. <td/>
  133. </tr>
  134. </table>
  135. <p>
  136. Legend:
  137. </p>
  138. <ul>
  139. <li>"(X)" means restricted support. Please see the details below.</li>
  140. <li>
  141. [1]: Requires the presence of <a href="http://jai-imageio.dev.java.net/">JAI Image I/O Tools</a>
  142. (or an equivalent Image I/O compatible codec) in the classpath. JAI Image I/O Tools also
  143. adds support for JPEG 2000, WBMP, RAW and PNM. Other Image I/O codecs may provide
  144. support for additional formats.
  145. </li>
  146. </ul>
  147. <note>
  148. <a href="http://jai-imageio.dev.java.net/">JAI Image I/O Tools</a> is not the same as the
  149. <a href="http://java.sun.com/javase/technologies/desktop/media/jai/">JAI library</a>! The
  150. former simply exposes JAI's codecs using the Image&amp;nbsp;I/O API but does not include all
  151. the image manipulation functionality.
  152. </note>
  153. <section id="format-map">
  154. <title>Map of supported image formats by output format</title>
  155. <p>
  156. Not all image formats are supported for all output formats! For example, while you can
  157. use EPS (Encapsulated PostScript) files when you generate PostScript output, this format
  158. will not be supported by any other output format. Here's an overview of which image
  159. formats are supported by which output format:
  160. </p>
  161. <table>
  162. <tr>
  163. <th>Image Format</th>
  164. <th>PDF</th>
  165. <th>PostScript</th>
  166. <th>Java2D, PNG, TIFF, AWT</th>
  167. <th>PCL</th>
  168. <th>AFP</th>
  169. <th>RTF</th>
  170. </tr>
  171. <tr>
  172. <td><a href="#bmp">BMP</a> (Microsoft Windows Bitmap)</td>
  173. <td>X</td>
  174. <td>X</td>
  175. <td>X</td>
  176. <td>X</td>
  177. <td>X</td>
  178. <td>X</td>
  179. </tr>
  180. <tr>
  181. <td><a href="#emf">EMF</a> (Windows Enhanced Metafile)</td>
  182. <td/>
  183. <td/>
  184. <td/>
  185. <td/>
  186. <td/>
  187. <td>X [1]</td>
  188. </tr>
  189. <tr>
  190. <td><a href="#eps">EPS</a> (Encapsulated PostScript)</td>
  191. <td/>
  192. <td>X [1]</td>
  193. <td/>
  194. <td/>
  195. <td/>
  196. <td/>
  197. </tr>
  198. <tr>
  199. <td>GIF (Graphics Interchange Format)</td>
  200. <td>X</td>
  201. <td>X</td>
  202. <td>X</td>
  203. <td>X</td>
  204. <td>X</td>
  205. <td>X</td>
  206. </tr>
  207. <tr>
  208. <td><a href="#jpeg">JPEG</a> (Joint Photographic Experts Group)</td>
  209. <td>X [1]</td>
  210. <td>X [1]</td>
  211. <td>X</td>
  212. <td>X</td>
  213. <td>X [1]</td>
  214. <td>X</td>
  215. </tr>
  216. <tr>
  217. <td><a href="#png">PNG</a> (Portable Network Graphic)</td>
  218. <td>X</td>
  219. <td>X</td>
  220. <td>X</td>
  221. <td>X</td>
  222. <td>X</td>
  223. <td>X</td>
  224. </tr>
  225. <tr>
  226. <td><a href="#svg">SVG</a> (Scalable Vector Graphics)</td>
  227. <td>X</td>
  228. <td>X</td>
  229. <td>X</td>
  230. <td>X</td>
  231. <td>X</td>
  232. <td>X</td>
  233. </tr>
  234. <tr>
  235. <td><a href="#tiff">TIFF</a> (Tag Image Format File)</td>
  236. <td>X [2]</td>
  237. <td>X [2]</td>
  238. <td>X</td>
  239. <td>X</td>
  240. <td>X [2]</td>
  241. <td>X</td>
  242. </tr>
  243. <tr>
  244. <td><a href="#wmf">WMF</a> (Windows Metafile)</td>
  245. <td>X</td>
  246. <td>X</td>
  247. <td>X</td>
  248. <td>X</td>
  249. <td>X</td>
  250. <td>X</td>
  251. </tr>
  252. </table>
  253. <p>
  254. Legend:
  255. </p>
  256. <ul>
  257. <li>
  258. [1]: Supported without the need to decode the image.
  259. </li>
  260. <li>
  261. [2]: Supported without the need to decode the image, but only for certain subtypes.
  262. </li>
  263. </ul>
  264. </section>
  265. </section>
  266. <section id="packages">
  267. <title>Graphics Packages</title>
  268. <section id="native">
  269. <title>XML Graphics Commons Native</title>
  270. <p>
  271. <a href="ext:xmlgraphics.apache.org/commons">XML Graphics Commons</a> supports a number
  272. of graphic file formats natively as basic functionality: all bitmap formats for which
  273. there are Image I/O codecs available (JPEG, PNG, GIF, TIFF, etc.), EPS and EMF.
  274. </p>
  275. </section>
  276. <section id="fop-native">
  277. <title>FOP Native</title>
  278. <p>
  279. FOP has no native image plug-ins for the image loading framework of its own but currently
  280. hosts the Batik-dependent SVG and WMF plug-ins until they can be moved to
  281. <a href="ext:xmlgraphics.apache.org/batik">Apache Batik</a>.
  282. </p>
  283. </section>
  284. <section id="batik">
  285. <title>Apache Batik</title>
  286. <p>
  287. <a href="ext:xmlgraphics.apache.org/batik">Apache Batik</a> will later receive the
  288. SVG and WMF plug-ins for the image loading framework that are currently hosted inside
  289. FOP.
  290. </p>
  291. <p>
  292. Current FOP distributions include a distribution of the
  293. <a class="fork" href="ext:xmlgraphics.apache.org/batik">Apache Batik</a>.
  294. Because Batik's API changes frequently, it is highly recommended that you use the
  295. version that ships with FOP, at least when running FOP.
  296. </p>
  297. <warning>Batik must be run in a graphical environment.</warning>
  298. <p>
  299. Batik must be run in a graphical environment.
  300. It uses AWT classes for rendering SVG, which in turn require an X server on Unixish
  301. systems. If you run a server without X, or if you can't connect to the X server due to
  302. security restrictions or policies (a so-called "headless" environment), SVG rendering
  303. will fail.
  304. </p>
  305. <p>Here are some workarounds:</p>
  306. <ul>
  307. <li>
  308. Start Java with the <code>-Djava.awt.headless=true</code> command line option.
  309. </li>
  310. <li>
  311. Install an X server which provides an in-memory framebuffer without actually using a
  312. screen device or any display hardware. One example is Xvfb.
  313. </li>
  314. <li>
  315. Install a toolkit which emulates AWT without the need for an underlying X server. One
  316. example is the <a href="http://www.eteks.com/pja/en">PJA toolkit</a>, which is free
  317. and comes with detailed installation instructions.
  318. </li>
  319. </ul>
  320. </section>
  321. <section id="imageio">
  322. <title>Image I/O</title>
  323. <p>
  324. The image loading framework in <a href="ext:xmlgraphics.apache.org/commons">XML Graphics Commons</a>
  325. provides a wrapper to load images through the
  326. <a class="fork" href="http://java.sun.com/j2se/1.4.2/docs/guide/imageio/index.html">JDK's Image I/O API</a> (JSR 015).
  327. Image I/O allows to dynamically add additional image codecs. An example of such an
  328. add-on library are the
  329. <a class="fork" href="http://java.sun.com/products/java-media/jai/">JAI Image I/O Tools</a>
  330. available from Sun.
  331. </p>
  332. </section>
  333. </section>
  334. <section id="image-formats">
  335. <title>Details on image formats</title>
  336. <section id="bmp">
  337. <title>BMP</title>
  338. <p>
  339. BMP images are supported through an Image I/O codec. There may be limitations of the
  340. codec which are outside the control of Apache FOP.
  341. </p>
  342. </section>
  343. <section id="emf">
  344. <title>EMF</title>
  345. <p>
  346. Windows Enhanced Metafiles (EMF) are only supported in RTF output where they are
  347. embedded without decoding.
  348. </p>
  349. </section>
  350. <section id="eps">
  351. <title>EPS</title>
  352. <p>Apache FOP allows to use EPS files when generating PostScript output only.</p>
  353. <p>
  354. Other output targets can't be supported at the moment because
  355. FOP lacks a PostScript interpreter. Furthermore, FOP is currently not able
  356. to parse the preview bitmaps sometimes contained in EPS files.
  357. </p>
  358. </section>
  359. <section id="gif">
  360. <title>GIF</title>
  361. <p>
  362. GIF images are supported through an Image&amp;nbsp;I/O codec. Transparency is supported but
  363. not guaranteed to work with every output format.
  364. </p>
  365. </section>
  366. <section id="jpeg">
  367. <title>JPEG</title>
  368. <p>
  369. FOP native support (i.e. the handling of undecoded images) of JPEG does not include all
  370. variants, especially those containing unusual color lookup tables and color profiles.
  371. If you have trouble with a JPEG image in FOP, try opening it with an image processing
  372. program (such as Photoshop or Gimp) and then saving it. Specifying 24-bit color output
  373. may also help. For the PDF and PostScript renderers most JPEG images can be passed
  374. through without decompression. User reports indicate that grayscale, RGB, and
  375. CMYK color spaces are all rendered properly. However, for other output formats, the
  376. JPEG images have to be decompressed. Tests have shown that there are some limitation
  377. in some Image&amp;nbsp;I/O codecs concerning images in the CMYK color space. Work-arounds are
  378. in place but may not always work as expected.
  379. </p>
  380. </section>
  381. <section id="png">
  382. <title>PNG</title>
  383. <p>
  384. PNG images are supported through an Image&amp;nbsp;I/O codec. Transparency is supported but
  385. not guaranteed to work with every output format.
  386. </p>
  387. </section>
  388. <section id="svg">
  389. <title>SVG</title>
  390. <section id="svg-intro">
  391. <title>Introduction</title>
  392. <p>FOP uses <a href="#batik"> Apache Batik</a> for SVG support.
  393. This format can be handled as an <code>fo:instream-foreign-object</code> or in a separate
  394. file referenced with <code>fo:external-graphic</code>.</p>
  395. <note>
  396. Batik's SVG Rasterizer utility may also be used to convert standalone SVG
  397. documents into PDF. For more information please see the
  398. <a href="http://xmlgraphics.apache.org/batik/svgrasterizer.html">SVG Rasterizer documentation</a>
  399. on the Batik site.
  400. </note>
  401. </section>
  402. <section id="svg-pdf-graphics">
  403. <title>Placing SVG Graphics into PDF</title>
  404. <p>
  405. The SVG is rendered into PDF by using PDF commands to draw and fill
  406. lines and curves. This means that the graphical objects created with
  407. this remain as vector graphics. The same applies to PostScript output.
  408. For other output formats the SVG graphic may be converted to a bitmap
  409. image.
  410. </p>
  411. <p>
  412. There are a number of SVG things that cannot be converted directly into
  413. PDF. Parts of the graphic such as effects, patterns and images are inserted
  414. into the PDF as a raster graphic. The resolution of these raster images can
  415. be controlled through the "target resolution" setting in the
  416. <a href="configuration.html">configuration</a>.</p>
  417. <p>
  418. Currently transparency is limited in PDF so some SVG images that
  419. contain effects or graphics with transparent areas may not be displayed
  420. correctly.
  421. </p>
  422. </section>
  423. <section id="svg-pdf-text">
  424. <title>Placing SVG Text into PDF and PostScript</title>
  425. <p>If possible, Batik will use normal PDF or PostScript text when inserting text. It does
  426. this by checking if the text can be drawn normally and the font is
  427. supported. This example svg <a href="../dev/svg/text.svg">text.svg</a> /
  428. <a href="../dev/svg/text.pdf">text.pdf</a> / <a href="../dev/svg/text.png">text.png</a>
  429. shows how various types and effects with text are handled.
  430. Note that SVG font support is not yet implemented. Furthermore, text handling in
  431. PostScript output is inferior to PDF output - more text will be painted as shapes in
  432. PS than in PDF.
  433. </p>
  434. <p>
  435. When there's no support to paint text using native text operations,
  436. text is converted and drawn as a set of shapes by Batik, using the
  437. stroking text painter. This means that a typical character will
  438. have about 10 curves (each curve consists of at least 20 characters).
  439. This can make the output files large and when it is viewed the
  440. viewer may not normally draw those fine curves very well (In Adobe Acrobat, turning on
  441. "Smooth Line Art" in the preferences will fix this). Copy/paste functionality
  442. will not be supported in this case.
  443. If the text is inserted into the output file using the inbuilt text commands
  444. it will use a single character.
  445. </p>
  446. <p>
  447. Note that because SVG text can be rendered as either text or a vector graphic, you
  448. may need to consider settings in your viewer for both. The Acrobat viewer has both
  449. "smooth line art" and "smooth text" settings that may need to be set for SVG images
  450. to be displayed nicely on your screen (see Edit / Preferences / Display).
  451. This setting will not affect the printing of your document, which should be OK in
  452. any case, but will only affect the quality of the screen display.
  453. </p>
  454. </section>
  455. <section id="svg-font-selection">
  456. <title>Font selection notes</title>
  457. <p>
  458. Apache Batik uses the AWT/Java2D subsystem as font source while FOP has its own font
  459. subsystem. Great care has been taken that font selection does the best possible choices.
  460. But it must be noted when creating PDF or PostScript that a font used in SVG graphics
  461. needs to be registered with the operating system as well as in FOP's configuration.
  462. By using FOP's font auto-detection, you simply have to install the font in the operating
  463. system and not care about anything else. This is less of an issue if you create
  464. formats like TIFFs, PNGs or PCL because in these cases SVG graphics are usually rendered
  465. to bitmaps which means that on both sides (Batik and FOP), AWT/Java2D is used as the
  466. single font source.
  467. </p>
  468. <p>
  469. Whenever an SVG is converted into a PDF or PostScript file, the font that has been used
  470. inside Batik has to be mapped to a font used by the actual output format. Features like
  471. font substitution in FOP may need to be taken into account but can also be an advantage
  472. when working around font mapping issues. Like for XSL-FO content, you'll get a warning
  473. if a particular font could not be found and had to be substituted, or if a particular
  474. glyph is missing in a font.
  475. </p>
  476. </section>
  477. <section id="svg-scaling">
  478. <title>Scaling</title>
  479. <p>
  480. Currently, SVG images are rendered with the dimensions specified <em>in the SVG
  481. file</em>, within the viewport specified in the fo:external-graphic element.
  482. For everything to work properly, the two should be equal. The SVG standard leaves
  483. this issue as an implementation detail. Additional scaling options are available
  484. through XSL-FO means.
  485. </p>
  486. <p>
  487. If you use pixels to specify the size of an SVG graphic the "source resolution" setting
  488. in the <a href="configuration.html">configuration</a> will be used to determine the
  489. size of a pixel. The use of pixels to specify sizes is discouraged as they may
  490. be interpreted differently in different environments.
  491. </p>
  492. </section>
  493. <section id="svg-problems">
  494. <title>Known Problems</title>
  495. <ul>
  496. <li>
  497. Soft mask transparency is combined with white so that it looks better
  498. on PDF 1.3 viewers but this causes the soft mask to be slightly lighter
  499. or darker on PDF 1.4 viewers.
  500. </li>
  501. <li>
  502. There is some problem with a gradient inside a pattern which may cause a PDF
  503. error when viewed in Acrobat 5.
  504. </li>
  505. <li>
  506. Text is not always handled correctly, it may select the wrong font
  507. especially if characters have multiple fonts in the font list.
  508. </li>
  509. <li>
  510. Uniform transparency for images and other SVG elements that are converted
  511. into a raster graphic are not drawn properly in PDF. The image is opaque.
  512. </li>
  513. </ul>
  514. </section>
  515. </section>
  516. <section id="tiff">
  517. <title>TIFF</title>
  518. <p>
  519. FOP can embed TIFF images without decompression into PDF, PostScript and AFP if they
  520. have either CCITT T.4, CCITT T.6, or JPEG compression. Otherwise, a TIFF-capable
  521. Image&amp;nbsp;I/O codec is necessary for decoding the image.
  522. </p>
  523. <p>
  524. There may be some limitation concerning images in the CMYK color space.
  525. </p>
  526. </section>
  527. <section id="wmf">
  528. <title>WMF</title>
  529. <p>
  530. Windows Metafiles (WMF) are supported through classes in
  531. <a href="ext:xmlgraphics.apache.org/batik">Apache Batik</a>. At the moment, support
  532. for this format is experimental and may not always work as expected.
  533. </p>
  534. </section>
  535. </section>
  536. <section id="resolution">
  537. <title>Graphics Resolution</title>
  538. <p>
  539. Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution
  540. values. FOP tries to use this resolution information whenever possible to determine
  541. the image's intrinsic size. This size is used during the layout process when it is not
  542. superseded by an explicit size on fo:external-graphic (content-width and content-height
  543. properties).
  544. </p>
  545. <p>
  546. Please note that not all images contain resolution information. If it's not available
  547. the source resolution set on the FopFactory (or through the user configuration XML) is used.
  548. The default here is 72 dpi.
  549. </p>
  550. <p>
  551. Bitmap images are generally embedded into the output format at their original resolution
  552. (as is). No resampling of the image is performed. Explicit resampling is on our wishlist,
  553. but hasn't been implemented, yet. Bitmaps included in SVG graphics may be resampled to
  554. the resolution specified in the "target resolution" setting in the
  555. <a href="configuration.html">configuration</a> if SVG filters are applied. This can be
  556. used as a work-around to resample images in FO documents.
  557. </p>
  558. </section>
  559. <section id="page-selection">
  560. <title>Page selection for multi-page formats</title>
  561. <p>
  562. Some image formats such as TIFF support multiple pages/sub-images per file. You can
  563. select a particular page using a special URI fragment in the form:
  564. &lt;uri&gt;#page=&lt;nr&gt;
  565. (for example: <code>http://localhost/images/myimage.tiff#page=3</code>)
  566. </p>
  567. </section>
  568. <section id="caching">
  569. <title>Image caching</title>
  570. <p>
  571. FOP caches images between runs. There is one cache per FopFactory instance. The URI is
  572. used as a key to identify images which means that when a particular URI appears again,
  573. the image is taken from the cache. If you have a servlet that generates a different
  574. image each time it is called with the same URI you need to use a constantly
  575. changing dummy parameter on the URI to avoid caching.
  576. </p>
  577. <p>
  578. The image cache has been improved considerably in the redesigned code. Therefore,
  579. resetting the image cache should be a thing of the past. If you
  580. still experience OutOfMemoryErrors, please notify us.
  581. </p>
  582. <p>
  583. If all else fails, the image cache can be cleared like this:
  584. <code>fopFactory.getImageManager().getCache().clearCache();</code>
  585. </p>
  586. </section>
  587. </body>
  588. </document>