source: trunk/Distribution/SW/FOP/build/site/graphics.html

Last change on this file was 2, checked in by jkacer, 18 years ago

Added all DocBook Framework stuff:

  • DocBook DTD
  • Transformation software FOP 0.20.5 and Saxon 6
  • XSL styles
  • Rexx scripts

Also added some WarpIN-related stuff for creation of WarpIN installation packages.
This state corresponds to version 1.0.0 from November 2005, just slightly modified to carry versioning information (Rexx scripts).

File size: 29.4 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<head>
4<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5<title>FOP Graphics Formats</title>
6<link type="text/css" href="skin/page.css" rel="stylesheet">
7</head>
8<body text="#000000" bgcolor="#FFFFFF">
9<!--================= start Navigation Path ==================-->
10<table summary="navigation path" width="100%" border="0" cellpadding="0" cellspacing="0">
11<tr>
12<td nowrap="nowrap" valign="middle" bgcolor="#CFDCED" height="20"><img height="1" width="5" alt="" border="0" src="skin/images/spacer.gif"><!--===== breadcrumb trail (javascript-generated) ====--><font size="2" face="Arial, Helvetica, Sans-serif"><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script></font></td>
13</tr>
14<tr>
15<td bgcolor="#4C6C8F" height="2"><img height="2" width="2" alt="" border="0" src="skin/images/spacer.gif"></td>
16</tr>
17</table>
18<!--================= end Navigation Path ==================-->
19<!--================= start Banner ==================-->
20<table summary="header with logos" width="100%" border="0" cellpadding="0" cellspacing="0">
21<tr>
22<!--================= start Group Logo ==================-->
23<td bgcolor="#294563"><a href="http://xml.apache.org/"><img border="0" class="logoImage" alt="Apache XML" src="images/group-logo.gif"></a></td>
24<!--================= end Group Logo ==================-->
25<!--================= start Project Logo ==================--><td width="100%" align="center" bgcolor="#294563"><a href="http://xml.apache.org/fop/"><img border="0" class="logoImage" alt="FOP" src="images/logo.jpg"></a></td>
26<!--================= end Project Logo ==================-->
27<!--================= start Search ==================--><td valign="top" rowspan="2" bgcolor="#294563">
28<form target="_blank" action="http://www.google.com/search" method="get">
29<table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F">
30<tr>
31<td colspan="3"><img height="10" width="1" alt="" src="skin/images/spacer.gif"></td>
32</tr>
33<tr>
34<td><img height="1" width="1" alt="" src="skin/images/spacer.gif"></td><td nowrap="nowrap"><input value="xml.apache.org" name="sitesearch" type="hidden"><input size="15" name="q" id="query" type="text"><img height="1" width="5" alt="" src="skin/images/spacer.gif"><input name="Search" value="Search" type="submit">
35<br>
36<font face="Arial, Helvetica, Sans-serif" size="2" color="white">
37 the Apache XML site
38
39
40 </font></td><td><img height="1" width="1" alt="" src="skin/images/spacer.gif"></td>
41</tr>
42<tr>
43<td><img alt="" border="0" height="10" width="9" src="skin/images/search-left.gif"></td><td><img height="1" width="1" alt="" src="skin/images/spacer.gif"></td><td><img alt="" border="0" height="10" width="9" src="skin/images/search-right.gif"></td>
44</tr>
45</table>
46</form>
47</td>
48<!--================= start Search ==================--><td bgcolor="#294563"><img height="10" width="10" alt="" src="skin/images/spacer.gif"></td>
49</tr>
50<tr>
51<td valign="bottom" bgcolor="#294563" colspan="2">
52<!--================= start Tabs ==================-->
53<div class="tab">
54<table summary="tab bar" border="0" cellpadding="0" cellspacing="0">
55<tr>
56<td width="8"><img alt="" height="8" width="8" src="skin/images/spacer.gif"></td><td valign="bottom">
57<table summary="selected tab" style="height: 1.7em" border="0" cellpadding="0" cellspacing="0">
58<tr>
59<td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="skin/images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b><a href="index.html"><font color="#000000">Home</font></a></b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="skin/images/tabSel-right.gif"></td>
60</tr>
61</table>
62</td><td width="8"><img alt="" height="8" width="8" src="skin/images/spacer.gif"></td><td valign="bottom">
63<table summary="non selected tab" style="height: 1.6em" border="0" cellpadding="0" cellspacing="0">
64<tr>
65<td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="skin/images/tab-left.gif"></td><td valign="middle" bgcolor="#B2C4E0"><a href="dev/index.html"><font face="Arial, Helvetica, Sans-serif">Development</font></a></td><td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="skin/images/tab-right.gif"></td>
66</tr>
67</table>
68</td>
69</tr>
70</table>
71</div>
72<!--================= end Tabs ==================-->
73</td><td bgcolor="#294563"><img alt="" width="1" height="1" src="skin/images/spacer.gif"></td>
74</tr>
75<tr>
76<td bgcolor="#4C6C8F" colspan="4"><img width="1" height="10" alt="" src="skin/images/spacer.gif"></td>
77</tr>
78</table>
79<!--================= end Banner ==================-->
80<!--================= start Menu, NavBar, Content ==================-->
81<table summary="page content" bgcolor="#ffffff" width="100%" border="0" cellpadding="0" cellspacing="0">
82<tr>
83<td valign="top">
84<table summary="menu" border="0" cellspacing="0" cellpadding="0">
85<tr>
86<!--================= start left top NavBar ==================-->
87<td rowspan="3" valign="top">
88<table summary="blue line" border="0" cellpadding="0" cellspacing="0">
89<tr>
90<td bgcolor="#294563"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td>
91</tr>
92<tr>
93<td bgcolor="#CFDCED"><font color="#4C6C8F" size="4" face="Arial, Helvetica, Sans-serif">&nbsp;</font></td>
94</tr>
95<tr>
96<td bgcolor="#294563"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td>
97</tr>
98</table>
99</td>
100<!--================= end left top NavBar ==================--><td bgcolor="#294563"><img width="1" height="1" alt="" src="skin/images/spacer.gif"></td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="skin/images/spacer.gif"></td><td nowrap="nowrap" valign="top" bgcolor="#4C6C8F">
101<!--================= start Menu items ==================-->
102<div class="menu">
103<ul>
104<li>
105<font color="#CFDCED">Home</font>
106<ul>
107
108<li>
109<a href="index.html">Introduction</a>
110</li>
111
112</ul>
113</li>
114<li>
115<font color="#CFDCED">Using FOP</font>
116<ul>
117
118<li>
119<a href="relnotes.html">Release Notes</a>
120</li>
121
122<li>
123<a href="download.html">Download</a>
124</li>
125
126<li>
127<a href="compiling.html">Build</a>
128</li>
129
130<li>
131<a href="configuration.html">Configure</a>
132</li>
133
134<li>
135<a href="running.html">Run</a>
136</li>
137
138<li>
139<a href="embedding.html">Embed</a>
140</li>
141
142<li>
143<a href="servlets.html">Servlets</a>
144</li>
145
146<li>
147<a href="anttask.html">Ant task</a>
148</li>
149
150</ul>
151</li>
152<li>
153<font color="#CFDCED">Features</font>
154<ul>
155
156<li>
157<a href="compliance.html">Compliance</a>
158</li>
159
160<li>
161<a href="output.html">Output Targets</a>
162</li>
163
164<li>
165<a href="pdfencryption.html">PDF encryption</a>
166</li>
167
168<li>
169<span class="sel"><font color="#ffcc00">Graphics</font></span>
170</li>
171
172<li>
173<a href="fonts.html">Fonts</a>
174</li>
175
176<li>
177<a href="hyphenation.html">Hyphenation</a>
178</li>
179
180<li>
181<a href="extensions.html">Extensions</a>
182</li>
183
184</ul>
185</li>
186<li>
187<font color="#CFDCED">Resources</font>
188<ul>
189
190<li>
191<a href="gethelp.html">Getting Help</a>
192</li>
193
194<li>
195<a href="faq.html">FAQs</a>
196</li>
197
198<li>
199<a href="fo.html">XSL-FO</a>
200</li>
201
202<li>
203<a href="examples.html">Examples</a>
204</li>
205
206<li>
207<a href="maillist.html">Mailing Lists</a>
208</li>
209
210<li>
211<a href="bugs.html">Bugs</a>
212</li>
213
214<li>
215<a href="license.html">License</a>
216</li>
217
218<li>
219<a href="resources.html">Other</a>
220</li>
221
222</ul>
223</li>
224<li>
225<font color="#CFDCED">Project</font>
226<ul>
227
228<li>
229<a href="news.html">News</a>
230</li>
231
232<li>
233<a href="logocontest.html">Logo contest</a>
234</li>
235
236<li>
237<a href="status.html">Status</a>
238</li>
239
240
241<li>
242<a href="team.html">Team</a>
243</li>
244
245</ul>
246</li>
247</ul>
248</div>
249<!--================= end Menu items ==================-->
250</td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="skin/images/spacer.gif"></td><td bgcolor="#294563"><img width="1" height="1" alt="" src="skin/images/spacer.gif"></td>
251</tr>
252<tr>
253<td valign="bottom" align="left" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="skin/images/menu-left.gif"></td><td bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="skin/images/spacer.gif"></td><td valign="bottom" align="right" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="skin/images/menu-right.gif"></td>
254</tr>
255<tr>
256<td height="1" bgcolor="#294563"><img width="1" height="1" alt="" src="skin/images/spacer.gif"></td>
257</tr>
258</table>
259</td><td valign="top" width="100%">
260<table summary="content" width="100%" border="0" cellpadding="0" cellspacing="0">
261<!--================= start middle NavBar ==================-->
262<tr>
263<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td>
264</tr>
265<tr>
266<td align="left" width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td><td align="left" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif">
267 &nbsp;
268
269 </font><img width="10" height="8" alt="" src="skin/images/spacer.gif"></td><td align="right" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif">
270 &nbsp;
271
272 </font><img width="10" height="8" alt="" src="skin/images/spacer.gif"></td><td width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td>
273</tr>
274<tr>
275<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td>
276</tr>
277<!--================= end middle NavBar ==================-->
278<!--================= start Content==================-->
279<tr>
280<td align="left" width="10"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td><td align="left" width="100%">
281<div class="content">
282<table class="title" summary="">
283<tr>
284<td valign="middle">
285<h1>FOP Graphics Formats</h1>
286</td><td nowrap="nowrap" width="80" align="center"><a class="dida" href="graphics.pdf"><img alt="printer" src="skin/images/printer.gif" border="0"><br>
287 print-friendly<br>
288 PDF</a></td>
289</tr>
290</table>
291<ul class="minitoc">
292<li>
293<a href="#support-overview">Overview of Graphics Support</a>
294</li>
295<li>
296<a href="#packages">Graphics Packages</a>
297<ul class="minitoc">
298<li>
299<a href="#native">FOP Native</a>
300</li>
301<li>
302<a href="#jimi">JIMI</a>
303</li>
304<li>
305<a href="#jai">JAI (Java Advanced Imaging API)</a>
306</li>
307<li>
308<a href="#batik">Batik</a>
309</li>
310</ul>
311</li>
312<li>
313<a href="#bmp">BMP</a>
314</li>
315<li>
316<a href="#eps">EPS</a>
317</li>
318<li>
319<a href="#jpeg">JPEG</a>
320</li>
321<li>
322<a href="#png">PNG</a>
323</li>
324<li>
325<a href="#svg">SVG</a>
326<ul class="minitoc">
327<li>
328<a href="#svg-intro">Introduction</a>
329</li>
330<li>
331<a href="#svg-pdf-graphics">Placing SVG Graphics into PDF</a>
332</li>
333<li>
334<a href="#svg-pdf-text">Placing SVG Text into PDF</a>
335</li>
336<li>
337<a href="#svg-scaling">Scaling</a>
338</li>
339<li>
340<a href="#svg-problems">Known Problems</a>
341</li>
342</ul>
343</li>
344<li>
345<a href="#tiff">TIFF</a>
346</li>
347<li>
348<a href="#resolution">Graphics Resolution</a>
349</li>
350<li>
351<a href="#caching">Image caching</a>
352</li>
353</ul>
354
355<a name="N101BE"></a><a name="support-overview"></a>
356<h3>Overview of Graphics Support</h3>
357<div style="margin-left: 0 ; border: 2px">
358<p>
359 The table below summarizes the <em>theoretical</em> support for graphical formats within FOP. In other words, within the constraints of the limitations listed here, these formats <em>should</em> work. However, many of them have not been tested, and there may be limitations that have not yet been discovered or documented. The packages needed to support some formats are not included in the FOP distribution and must be installed separately. Follow the links in the "Support Thru" column for more details.
360 </p>
361<table class="ForrestTable" cellspacing="1" cellpadding="4">
362
363<tr>
364
365<th colspan="1" rowspan="1">Format</th>
366 <th colspan="1" rowspan="1">Type</th>
367 <th colspan="1" rowspan="1">Support Thru</th>
368
369</tr>
370
371<tr>
372
373<td colspan="1" rowspan="1"><a href="#bmp">BMP</a> (Microsoft Windows Bitmap)</td>
374 <td colspan="1" rowspan="1">bitmap</td>
375 <td colspan="1" rowspan="1"><a href="#native">FOP native</a></td>
376
377</tr>
378
379<tr>
380
381<td colspan="1" rowspan="1"><a href="#eps">EPS</a> (Encapsulated PostScript)</td>
382 <td colspan="1" rowspan="1">metafile (both bitmap and vector), probably most frequently used for vector drawings</td>
383 <td colspan="1" rowspan="1"><a href="#native">FOP native</a> (limited support, see restrictions below)</td>
384
385</tr>
386
387<tr>
388
389<td colspan="1" rowspan="1">GIF (Graphics Interchange Format)</td>
390 <td colspan="1" rowspan="1">bitmap</td>
391 <td colspan="1" rowspan="1"><a href="#native">FOP native</a></td>
392
393</tr>
394
395<tr>
396
397<td colspan="1" rowspan="1"><a href="#jpeg">JPEG</a> (Joint Photographic Experts Group)</td>
398 <td colspan="1" rowspan="1">bitmap</td>
399 <td colspan="1" rowspan="1"><a href="#native">FOP native</a></td>
400
401</tr>
402
403<tr>
404
405<td colspan="1" rowspan="1"><a href="#png">PNG</a> (Portable Network Graphic)</td>
406 <td colspan="1" rowspan="1">bitmap</td>
407 <td colspan="1" rowspan="1"><a href="#jimi">JIMI</a> or <a href="#jai">JAI</a></td>
408
409</tr>
410
411<tr>
412
413<td colspan="1" rowspan="1"><a href="#svg">SVG</a> (Scalable Vector Graphics)</td>
414 <td colspan="1" rowspan="1">vector (with embedded bitmaps)</td>
415 <td colspan="1" rowspan="1"><a href="#batik">Batik</a></td>
416
417</tr>
418
419<tr>
420
421<td colspan="1" rowspan="1"><a href="#tiff">TIFF</a> (Tag Image Format File)</td>
422 <td colspan="1" rowspan="1">bitmap</td>
423 <td colspan="1" rowspan="1"><a href="#native">FOP native</a> or <a href="#jai">JAI</a>, depending on the subformat. See <a href="#tiff">TIFF</a> for more details.(JIMI also supports TIFF, but this has not been implemented within FOP).</td>
424
425</tr>
426
427</table>
428</div>
429
430<a name="N1028F"></a><a name="packages"></a>
431<h3>Graphics Packages</h3>
432<div style="margin-left: 0 ; border: 2px">
433<a name="N10295"></a><a name="native"></a>
434<h4>FOP Native</h4>
435<div style="margin-left: 0 ; border: 2px">
436<p>
437 FOP has native ability to handle some graphic file formats.
438 </p>
439</div>
440<a name="N1029F"></a><a name="jimi"></a>
441<h4>JIMI</h4>
442<div style="margin-left: 0 ; border: 2px">
443<p>
444 Because of licensing issues, the JIMI image library is not included in the FOP distribution. First, <a target="_blank" href="http://java.sun.com/products/jimi">download</a> and install it.
445Then, copy the file "JimiProClasses.zip" from the archive to {fop-install-dir}/lib/jimi-1.0.jar. Please note that FOP binary distributions are compiled with JIMI support, so there is no need for you to build FOP to add the support. If jimi-1.0.jar is installed in the right place, it will automatically be used by FOP, otherwise it will not.
446 </p>
447</div>
448<a name="N102AD"></a><a name="jai"></a>
449<h4>JAI (Java Advanced Imaging API)</h4>
450<div style="margin-left: 0 ; border: 2px">
451<div class="frame warning">
452<div class="label">Warning</div>
453<div class="content">JAI support is available for Release 0.20.5 and later. The comments in this section do not apply to releases earlier than 0.20.5.</div>
454</div>
455<p>
456 FOP has been compiled with JAI support, but JAI is not included in the FOP distribution.
457To use it, install <a href="http://java.sun.com/products/java-media/jai">JAI</a>, then copy the jai_core.jar and the jai_codec.jar files to {fop-install-dir}/lib.
458JAI is much faster than JIMI, but is not available for all platforms. See <a href="http://java.sun.com/products/java-media/jai/forDevelopers/jaifaq.html#platforms">What platforms are supported?</a> on the JAI FAQ page for more details.
459 </p>
460</div>
461<a name="N102C2"></a><a name="batik"></a>
462<h4>Batik</h4>
463<div style="margin-left: 0 ; border: 2px">
464<p>Current FOP distributions include a distribution of the Apache Software Foundation's <a target="_top" href="http://xml.apache.org/batik">Batik</a> version 1.5beta4.
465It is automatically installed with FOP.
466Because Batik's API changes frequently, it is highly recommended that you use the version that ships with FOP, at least when running FOP.</p>
467<div class="frame warning">
468<div class="label">Warning</div>
469<div class="content">Batik must be run in a graphical environment.</div>
470</div>
471<p>Batik must be run in a graphical environment.
472It uses AWT classes for rendering SVG, which in turn require an X server on Unixish systems.
473If you run a server without X, or if you can't connect to the X server due to security restrictions or policies (a so-called "headless" environment), SVG rendering will fail.</p>
474<p>Here are some workarounds:</p>
475<ul>
476
477<li>If you are using JDK 1.4, start it with the <span class="codefrag">-Djava.awt.headless=true</span> command line option.</li>
478
479<li>Install an X server which provides an in-memory framebuffer without actually using a screen device or any display hardware. One example is Xvfb.</li>
480
481<li>Install a toolkit which emulates AWT without the need for an underlying X server. One example is the <a href="http://www.eteks.com/pja/en">PJA toolkit</a>, which is free and comes with detailed installation instructions.</li>
482
483</ul>
484</div>
485</div>
486
487<a name="N102ED"></a><a name="bmp"></a>
488<h3>BMP</h3>
489<div style="margin-left: 0 ; border: 2px">
490<p>FOP native support for BMP images is limited to the RGB color-space.</p>
491</div>
492
493<a name="N102F7"></a><a name="eps"></a>
494<h3>EPS</h3>
495<div style="margin-left: 0 ; border: 2px">
496<p>FOP provides support for two output targets:</p>
497<ul>
498
499<li>PostScript (full support).</li>
500
501<li>
502 PDF (partial support). Due to the lack of a built-in PostScript interpreter, FOP
503 can only embed the EPS file into the PDF. Acrobat Reader will not currently display
504 the EPS (it doesn't have a PostScript interpreter, either) but it will be shown
505 correctly when you print the PDF on a PostScript-capable printer. PostScript devices
506 (including GhostScript) will render the EPS correctly.
507 </li>
508
509</ul>
510<p>
511 Other output targets can't be supported at the moment because
512 FOP lacks a PostScript interpreter.
513 </p>
514</div>
515
516<a name="N1030D"></a><a name="jpeg"></a>
517<h3>JPEG</h3>
518<div style="margin-left: 0 ; border: 2px">
519<p>FOP native support of JPEG does not include all variants, especially those containing unusual color lookup tables and color profiles.
520If you have trouble with a JPEG image in FOP, try opening it with an image processing program (such as Photoshop or Gimp) and then saving it.
521Specifying 24-bit color output may also help.
522For the PDF and PostScript renderers most JPEG images can be passed through without decompression.
523User reports indicate that grayscale, RGB, and CMYK color-spaces are all rendered properly.
524 </p>
525</div>
526
527<a name="N10317"></a><a name="png"></a>
528<h3>PNG</h3>
529<div style="margin-left: 0 ; border: 2px">
530<p>If using JAI for PNG support, only RGB and RGBA color-spaces are supported for FOP rendering.</p>
531</div>
532
533<a name="N10321"></a><a name="svg"></a>
534<h3>SVG</h3>
535<div style="margin-left: 0 ; border: 2px">
536<a name="N10327"></a><a name="svg-intro"></a>
537<h4>Introduction</h4>
538<div style="margin-left: 0 ; border: 2px">
539<p>FOP uses <a href="#batik">Batik</a> for SVG support.
540This format can be handled as an <span class="codefrag">fo:instream-foreign-object</span> or in a separate
541file referenced with <span class="codefrag">fo:external-graphic</span>.</p>
542<div class="frame note">
543<div class="label">Note</div>
544<div class="content">
545Batik's SVG Rasterizer utility may also be used to convert standalone SVG
546documents into PDF. For more information please see the
547<a href="http://xml.apache.org/batik/svgrasterizer.html">SVG Rasterizer documentation</a>
548on the Batik site.
549 </div>
550</div>
551</div>
552<a name="N10342"></a><a name="svg-pdf-graphics"></a>
553<h4>Placing SVG Graphics into PDF</h4>
554<div style="margin-left: 0 ; border: 2px">
555<p>
556The SVG is rendered into PDF by using PDF commands to draw and fill
557lines and curves. This means that the graphical objects created with
558this remain as vector graphics.
559 </p>
560<p>
561There are a number of SVG things that cannot be converted directly into
562PDF. Parts of the graphic such as effects, patterns and images are inserted
563into the PDF as a raster graphic. The resolution of this graphic may not
564be ideal depending on the FOP dpi (72dpi) and the scaling for that graphic.
565We hope to improve this in the future.</p>
566<p>
567Currently transparency is not supported in PDF so many svg images that
568contain effects or graphics with transparent areas will not be displayed
569correctly.
570 </p>
571</div>
572<a name="N10352"></a><a name="svg-pdf-text"></a>
573<h4>Placing SVG Text into PDF</h4>
574<div style="margin-left: 0 ; border: 2px">
575<p>If possible, Batik will use normal PDF text when inserting text. It does
576this by checking if the text can be drawn normally and the font is
577supported. This example svg <a href="dev/svg/text.svg">text.svg</a> /
578<a href="dev/svg/text.pdf">text.pdf</a>
579shows how various types and effects with text are handled.
580Note that tspan and outlined text are not yet implemented.</p>
581<p>
582Otherwise, text is converted and drawn as a set of shapes by batik, using the stroking text painter.
583This means that a typical character will
584have about 10 curves (each curve consists of at least 20 characters).
585This can make the pdf files large and when the pdf is viewed the
586viewer does not normally draw those fine curves very well (turning on
587Smooth Line Art in the Acrobat preferences will fix this).
588If the text is inserted into the PDF using the inbuilt text commands
589for PDF it will use a single character.
590 </p>
591<p>
592For PDF output, there is a <a href="configuration.html#svg-strokeSVGText">configuration option to force SVG text to be rendered as text</a>.
593The drawback to this approach is that it is effective only for available fonts (including embedded fonts).
594Font sizes are rounded to the next integer point size.
595This will be improved in the future.
596 </p>
597<p>Note that because SVG text can be rendered as either text or a vector graphic, you may need to consider settings in your viewer for both.
598The Acrobat viewer has both "smooth line art" and "smooth text" settings that may need to be set for SVG images to be displayed nicely on your screen (see Edit / Preferences / Display).
599This setting will not affect the printing of your document, which should be OK in any case, but will only affect the quality of the screen display.</p>
600</div>
601<a name="N10371"></a><a name="svg-scaling"></a>
602<h4>Scaling</h4>
603<div style="margin-left: 0 ; border: 2px">
604<p>Currently, SVG images are rendered with the dimensions specified <em>in the SVG file</em>, within the viewport specified in the fo:external-graphic element.
605For everything to work properly, the two should be equal.
606The SVG standard leaves this issue as an implementation detail.
607FOP will probably implement a scaling mechanism in the future.</p>
608</div>
609<a name="N1037E"></a><a name="svg-problems"></a>
610<h4>Known Problems</h4>
611<div style="margin-left: 0 ; border: 2px">
612<ul>
613
614<li>
615soft mask transparency is combined with white so that it looks better
616on pdf 1.3 viewers but this causes the soft mask to be slightly lighter
617or darker on pdf 1.4 viewers
618 </li>
619
620<li>
621there is some problem with a gradient inside a pattern causing a pdf
622error when viewed in acrobat 5
623 </li>
624
625<li>
626text is not always handled correctly, it may select the wrong font
627especially if characters have multiple fonts in the font list
628 </li>
629
630<li>
631more pdf text handling could be implemented
632It could draw the string using the attributed character iterator
633to handle tspans and other simple changes of text.
634 </li>
635
636<li>
637JPEG images are not inserted directly into the pdf document
638This area has not been implemented yet since the appropriate
639method in batik is static
640 </li>
641
642<li>
643Uniform transparency for images and other svg elements that are converted
644into a raster graphic are not drawn properly in PDF. The image is opaque.
645 </li>
646
647</ul>
648</div>
649</div>
650
651<a name="N1039B"></a><a name="tiff"></a>
652<h3>TIFF</h3>
653<div style="margin-left: 0 ; border: 2px">
654<p>FOP-native TIFF support is limited to PDF and PostScript output only. Also, according to user reports, FOP's native support for TIFF is limited to images with the following characteristics (all must be true for successful rendering):</p>
655<ul>
656
657<li>single channel images (i.e., bi-level and grayscale only)</li>
658
659<li>uncompressed images, or images using CCITT T.4, CCITT T.6, or JPEG compression</li>
660
661<li>images using white-is-zero encoding in the TIFF PhotometricInterpretation tag</li>
662
663</ul>
664<p>
665<em>JAI:</em> Supports RGB and RGBA only for FOP rendering.</p>
666</div>
667
668<a name="N103B6"></a><a name="resolution"></a>
669<h3>Graphics Resolution</h3>
670<div style="margin-left: 0 ; border: 2px">
671<p>Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution value. Since PDF and most output formats do not have a concept of resolution, but only of absolute image units (i.e. pixels) FOP ignores the resolution values as well. Instead, FOP uses the dimensions of the image as specified in the fo:external-graphic element to render the image:</p>
672<ul>
673
674<li>If no dimensions are given, FOP uses a default value of 72 dpi to compute the graphic's dimensions. For example, suppose a graphic 300 pixels wide and 400 pixels high. FOP will render the graphic at 4.167 inches wide, 5.555 inches high, with an apparent resolution of 72 dpi.</li>
675
676<li>If only one dimension is given, FOP by default uses the same aspect ratio to compute the other dimension (to avoid the appearance of stretching). For example, suppose a graphic 300 pixels wide and 400 pixels high, for which content-width = ".5in". FOP will compute the content-height = .667 inches, and will render the graphic at that size, with an apparent resolution of 600 dpi.</li>
677
678<li>If both dimensions are given, FOP simply renders the image in that space. For example, suppose a graphic 300 pixels wide and 400 pixels high, for which content-width = "3in" and content-height = "4in". FOP will render the graphic at that size, with an apparent resolution of 100 dpi.</li>
679
680</ul>
681<p>If you need a higher apparent output resolution for bitmapped images, first make sure that at least one dimension of the image is defined in your XSL-FO input. Apart from that, resolution problems are in the image file itself, and must be corrected there: use or create a higher-resolution image file.</p>
682<div class="frame note">
683<div class="label">Note</div>
684<div class="content">The explanation above describes only the basic default behavior. There are other attributes of the fo:external-graphic element that can affect the behavior described above.</div>
685</div>
686</div>
687
688<a name="N103D2"></a><a name="caching"></a>
689<h3>Image caching</h3>
690<div style="margin-left: 0 ; border: 2px">
691<p>
692 FOP caches images between runs. The URL is used as a key to identify images which means that when
693 a particular URL appears again, the image is taken from the cache. If you have a servlet that
694 generates a different image each time it is called with the same URL you need to use a constantly
695 changing dummy parameter on the URL to avoid caching.
696 </p>
697<p>
698 Currently, the images are not automatically released when an OutOfMemoryError is imminent. The
699 image cache can grow to a considerable size over time when a lot of different URLs are in use.
700 Starting with version 0.20.5 you can call <span class="codefrag">org.apache.fop.image.FopImageFactory.resetCache()</span>
701 to manually empty the cache. Image caching will be improved as part of our redesign effort.
702 </p>
703</div>
704
705</div>
706</td><td width="10"><img width="10" height="1" alt="" src="skin/images/spacer.gif"></td>
707</tr>
708<!--================= end Content==================-->
709</table>
710</td>
711</tr>
712</table>
713<!--================= end Menu, NavBar, Content ==================-->
714<!--================= start Footer ==================-->
715<table summary="footer" cellspacing="0" cellpadding="0" width="100%" border="0">
716<tr>
717<td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1" width="1" alt="" src="skin/images/spacer.gif"><a href="skin/images/label.gif"></a><a href="skin/images/page.gif"></a><a href="skin/images/chapter.gif"></a><a href="skin/images/chapter_open.gif"></a><a href="skin/images/current.gif"></a><a href="/favicon.ico"></a></td>
718</tr>
719<tr>
720<td colspan="2" bgcolor="#CFDCED" class="copyright" align="center"><font size="2" face="Arial, Helvetica, Sans-Serif">Copyright &copy;
721 1999-2003&nbsp;The Apache Software Foundation. All rights reserved.<script type="text/javascript" language="JavaScript"><!--
722 document.write(" - "+"Last Published: " + document.lastModified);
723 // --></script></font></td>
724</tr>
725<tr>
726<td colspan="2" align="left" bgcolor="#CFDCED" class="logos"></td>
727</tr>
728</table>
729<!--================= end Footer ==================-->
730</body>
731</html>
Note: See TracBrowser for help on using the repository browser.