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.

faq.xml 57KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355
  1. <?xml version="1.0" encoding="UTF-8"?>
  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 faqs PUBLIC "-//APACHE//DTD FAQ V1.3//EN" "http://forrest.apache.org/dtd/faq-v12.dtd">
  18. <faqs title="FOP FAQ">
  19. <part id="part-general">
  20. <title>Apache™ FOP: General questions</title>
  21. <faq id="fop-general">
  22. <question>What is Apache™ FOP?</question>
  23. <answer>
  24. <p>
  25. FOP is a print formatter for <link href="#xslfo">XSL formatting
  26. objects</link>.
  27. </p>
  28. <p>
  29. It can be used to render an XML file containing XSL formatting objects
  30. into a page layout. The main target is PDF but other rendering targets
  31. are supported, such as AWT, PCL, text and direct printing.
  32. </p>
  33. </answer>
  34. </faq>
  35. <faq id="fop-functions">
  36. <question>What can I do with FOP?</question>
  37. <answer>
  38. <p>
  39. FOP provides both an application and a library that converts an XSL FO
  40. document into paginated output.
  41. </p>
  42. <p>
  43. The FOP command line application can be directly used to transform XML
  44. into PDF, PostScript, PCL and other formats, there is also an AWT
  45. based viewer integrated.
  46. </p>
  47. <p>
  48. The library can be used in servlets and other Java applications.
  49. </p>
  50. </answer>
  51. </faq>
  52. <faq id="fop-acronym">
  53. <question>What does "FOP" stand for?</question>
  54. <answer>
  55. <p>
  56. FOP is an acronym for <strong>F</strong>ormatting
  57. <strong>O</strong>bject <strong>P</strong>rocessor
  58. </p>
  59. </answer>
  60. </faq>
  61. <faq id="fop-other-apache">
  62. <question>How does FOP interact with other Apache Projects?</question>
  63. <answer>
  64. <p>
  65. <link href="http://xmlgraphics.apache.org/commons">XML Graphics Commons</link> is used with
  66. FOP to provide graphics functions that are common to a number of Apache projects.
  67. </p>
  68. <p>
  69. <link href="http://xmlgraphics.apache.org/batik">Batik</link> is used with
  70. FOP to <link
  71. href="http://xmlgraphics.apache.org/batik/svgrasterizer.html">transcode an SVG
  72. image</link> into a PDF document.
  73. </p>
  74. <p>FOP also makes use of the following Apache projects:</p>
  75. <ul>
  76. <li><link href="http://excalibur.apache.org/framework/">Avalon Framework</link></li>
  77. <li><link href="http://jakarta.apache.org/commons/io/">Jakarta Commons IO</link></li>
  78. <li><link href="http://jakarta.apache.org/commons/logging/">Jakarta Commons Logging</link></li>
  79. <li><link href="http://xalan.apache.org/">Xalan-J</link></li>
  80. <li><link href="http://xml.apache.org/commons/components/external/">XML Commons Externals</link></li>
  81. </ul>
  82. </answer>
  83. </faq>
  84. <faq id="xsl-def">
  85. <question>What is XSL?</question>
  86. <answer>
  87. <p>
  88. XSL is a W3C standard concerned with publishing XML documents. It
  89. consists of two parts: <link href="#XSLT">XSLT</link> and <link
  90. href="#xslfo">XSL-FO</link>. The acronym expands to
  91. e<strong>X</strong>tensible <strong>S</strong>tylesheet
  92. <strong>L</strong>anguage.
  93. </p>
  94. </answer>
  95. </faq>
  96. <faq id="xslfo">
  97. <question>What is XSL-FO?</question>
  98. <answer>
  99. <p>
  100. XSLFO (aka XSL-FO) is an XML vocabulary, defined by W3C Recommendation
  101. <link href="http://www.w3.org/TR/xsl/">Extensible Stylesheet Language (XSL)
  102. Version 1.1</link>, that is used to specify a pagination and
  103. other styling for page layout output. The acronym &#8220;FO&#8221;
  104. stands for
  105. <strong>F</strong>ormatting <strong>O</strong>bjects. XSLFO can be
  106. used in conjunction with <link href="#XSLT">XSLT</link> to convert
  107. from any XML format into a paginated layout ready for printing or
  108. displaying.
  109. </p>
  110. <p>
  111. XSLFO defines a set of elements in XML that describes the way pages
  112. are set up. The contents of the pages are filled from flows. There can
  113. be static flows that appear on every page (for headers and footers)
  114. and the main flow which fills the body of the page.
  115. </p>
  116. <p>
  117. Synonyms: XSL FO, XSL (FO), XSL:FO, XSL-FO, Formatting Objects
  118. </p>
  119. </answer>
  120. </faq>
  121. <faq id="XSLT">
  122. <question>What is XSLT?</question>
  123. <answer>
  124. <p>
  125. XSLT describes the transformation of arbitrary XML input into other
  126. XML (like XSLFO), HTML or plain text. The &#8220;T&#8221; comes from
  127. <strong>T</strong>ransformation. For historical reasons, a
  128. transformation is often also called a &#8220;style sheet&#8221;.
  129. </p>
  130. <p>
  131. Synonyms: XSL transformation, XSL:T, XSL style sheet.
  132. </p>
  133. </answer>
  134. </faq>
  135. <faq id="when">
  136. <question>When will feature X be implemented?</question>
  137. <answer>
  138. <p>The short answer is "Don't ask." For more details, see <link href="gethelp.html#limitations">Understand FOP's Limitations</link>.</p>
  139. </answer>
  140. </faq>
  141. <faq id="next-release">
  142. <question>When is the next released planned?</question>
  143. <answer>
  144. <p>
  145. Version 1.1 of FOP was released on 20 October 2012.
  146. Work on a new Version 1.2 of Apache FOP is underway at this time, with
  147. no fixed date set for its release.
  148. If you want to speed up the process, consider <link
  149. href="dev/index.html#involved">contributing</link> to FOP.
  150. </p>
  151. </answer>
  152. </faq>
  153. <faq id="redesign">
  154. <question>Why did you redesign FOP between Versions 0.2X and 0.9X?</question>
  155. <answer>
  156. <p>The code redesign of FOP was necessary in order to be able to adress following issues:</p>
  157. <ul>
  158. <li>Keeps and Breaks</li>
  159. <li>XSL-FO Compliance in general</li>
  160. <li>Process Files of Arbitrary Size</li>
  161. <li>Minimize Memory Use</li>
  162. <li>Table Layout</li>
  163. </ul>
  164. </answer>
  165. </faq>
  166. <faq id="contribute">
  167. <question>How can I contribute?</question>
  168. <answer>
  169. <p>
  170. There are numerous ways that you can help. They are outlined in the <link href="dev/index.html">Developer's Introduction</link> page.
  171. </p>
  172. </answer>
  173. </faq>
  174. </part>
  175. <part id="part-running">
  176. <title>Problems running FOP</title>
  177. <faq id="no-page-master">
  178. <question>I get the error: [ERROR]: 'master-reference' for
  179. 'fo:page-sequence' matches no 'simple-page-master' or
  180. 'page-sequence-master'</question>
  181. <answer>
  182. <p>
  183. FOP was changed to be in accordance with the latest standard (see
  184. <link href="resources.html#specs-xslfo">XSL standard</link>).The page
  185. master for a fo:page-sequence is now referenced by the
  186. master-reference attribute. Replace the master-name attributes of
  187. your fo:page-sequence elements by master-reference attributes. You
  188. have to do this also for fo:single-page-master-reference,
  189. fo:repeatable-page-master-reference and
  190. fo:conditional-page-master-reference elements in you page master
  191. definitions.
  192. </p>
  193. <p>
  194. Update your FO documents and style sheets.
  195. </p>
  196. </answer>
  197. </faq>
  198. <faq id="NoClassDefFound">
  199. <question>I get a NoClassDefFound exception.</question>
  200. <answer>
  201. <p>This is typically a problem with your classpath.</p>
  202. <p>If you are running FOP from the command line:</p>
  203. <ul>
  204. <li>
  205. Use the command file <code>fop.bat</code>, <code>fop.cmd</code> or <code>fop.js</code> on MS Windows, or <code>fop</code> on Unix/Linux from the FOP
  206. distribution.
  207. </li>
  208. <li>
  209. If this doesn't help, check whether still all the jar files
  210. mentioned in the classpath in the <code>fop.bat</code> file are in their
  211. respective places.
  212. </li>
  213. </ul>
  214. <p>
  215. If you run FOP embedded in your servlet, web application or
  216. other Java application, check the classpath of the
  217. application. Check the also the information pertaining to <link
  218. href="1.0/servlets.html#servlet-engine">servlet engines</link>
  219. for further hints.
  220. </p>
  221. <p>
  222. If you downloaded the source distribution, or a snapshop
  223. from the repository, remember you have to build the FOP jars
  224. first.
  225. </p>
  226. </answer>
  227. </faq>
  228. <faq id="NoSuchMethodException">
  229. <question>I get a NoSuchMethodException or a NoSuchFieldException
  230. exception.</question>
  231. <answer>
  232. <p>
  233. This is usually caused by an older version of one of the FOP jars or
  234. old XML tools in the classpath.
  235. </p>
  236. <p>
  237. Incompatible versions of Batik may also cause this problem. Use the
  238. version of Batik that comes with FOP. It is not always possible to
  239. use a more recent version of Batik.
  240. </p>
  241. </answer>
  242. </faq>
  243. <faq id="OutOfMemoryException">
  244. <question>I get an OutOfMemoryException.</question>
  245. <answer>
  246. <p>
  247. See <link href="1.0/running.html#memory">FOP Memory</link>.
  248. </p>
  249. </answer>
  250. </faq>
  251. <faq id="MalformedURLException">
  252. <question>I get a MalformedURLException.</question>
  253. <answer>
  254. <anchor id="MalformedURL"/>
  255. <p>
  256. What you probably think of as "file names" are usually URLs, in
  257. particular the <code>src</code> attribute of fo:external-graphic.
  258. </p>
  259. <p>
  260. Because usage of URLs is growing, you should make yourself familiar
  261. with it. The relevant specification is <link
  262. href="http://www.rfc-editor.org/rfc/rfc2396.txt">RFC 2396</link>.
  263. </p>
  264. <p>
  265. In a nutshell, the correct syntax for an absolute file URL is
  266. <code>file:///some/path/file.ext</code> on Unix and
  267. <code>file:///z:/some/path/file.ext</code> on Windows systems. Note
  268. the triple slash, and also that only forward slashes are used, even on
  269. windows.
  270. </p>
  271. <p>
  272. A relative file URL starts with anything but a slash, and doesn't have
  273. the <code>file:</code> prefix, for example <code>file.ext</code>,
  274. <code>path/file.ext</code> or <code>../file.ext</code>. The string
  275. <code>file:path/file.ext</code> is <em>not</em> a relative URL,
  276. in fact, it isn't a valid URL at all since the <code>file</code>
  277. scheme does not (officially) support relative paths. A relative URL
  278. is subject to a resolving process, which transforms it into an absolute
  279. URL.
  280. </p>
  281. <!--p>
  282. See Understanding URIs and URLs and Understanding
  283. URL resolving.
  284. </p-->
  285. </answer>
  286. </faq>
  287. <faq id="NullPointerException">
  288. <question>I get an "[ERROR]: null", or a NullPointerException.</question>
  289. <answer>
  290. <p>
  291. This is a very likely a bug in FOP. If you encounter this error, please
  292. <link href="bugs.html#issues_new">Open a New Bug</link>.
  293. </p>
  294. </answer>
  295. </faq>
  296. <faq id="not-implemented">
  297. <question>FOP returns the message "[ERROR] <em>object|property - 'x'</em> is not implemented yet." When will it be implemented?</question>
  298. <answer>
  299. <p>See FOP's Standards <link href="compliance.html">Compliance</link> page.</p>
  300. </answer>
  301. </faq>
  302. <faq id="fop-hangs">
  303. <question>FOP hangs. FOP does not exit.</question>
  304. <answer>
  305. <p>
  306. The most likely reason is a known problem with the Java run time
  307. environment which is triggered by rendering SVGs. Sun's JDK 1.4 and
  308. later do not have this problem. See also <link href="#svghangs">FOP
  309. does not exit if a SVG is included</link>.
  310. </p>
  311. <p>
  312. Another possibility is that FOP went into a non terminating
  313. loop. Usually this is indicated by lots of log messages of the form
  314. "[INFO]: [NNNN]" which indicate a new page has been started or <link
  315. href="#boxoverflow">box overflows</link>. After some time, FOP will
  316. crash with an OutOfMemoryException.
  317. </p>
  318. <p>
  319. If you called the FOP command line application from some other
  320. program, for example from Java using Runtime.exec(), it may hang
  321. while trying to write log entries to the output pipe. You have to read
  322. the FOP output regularly to empty the pipe buffer. It is best to avoid
  323. exec'ing FOP, use the library interface instead.
  324. </p>
  325. <p>
  326. If you can reproduce this problem given a specific input and configuration,
  327. then please <link href="bugs.html#issues_new">Open a New Bug</link>.
  328. </p>
  329. </answer>
  330. </faq>
  331. <faq id="boxoverflow">
  332. <question>FOP runs forever, writing lots of "&gt;" to the log.</question>
  333. <answer>
  334. <p>
  335. There is something too large to fit into the intended place, usually a
  336. large image, a table whose rows are kept together or a block with a
  337. space-before or space-after larger than the page size. Catch the first
  338. page showing this phenomenon and check it. If it is not obvious which
  339. element causes the trouble, remove stuff until the problem goes
  340. away. Decrease the dimensions of the offending element or property, or
  341. increase the dimension of the enclosing element or container, or
  342. remove keep-with-* properties.
  343. </p>
  344. </answer>
  345. </faq>
  346. <faq id="cannot-find-external-graphics">
  347. <question>FOP cannot find a file for fo:external-graphics.</question>
  348. <answer>
  349. <p>The src attribute of the <code>fo:external-graphics</code> element requires a URI, not a file name. See <link href="fo.html#external-resources">External Resources</link> for more information about specifying URIs.</p>
  350. </answer>
  351. </faq>
  352. <faq id="fonts-not-found">
  353. <question>FOP does not find my fonts.</question>
  354. <answer>
  355. <p>
  356. Did you get: &#8220;Failed to read font metrics file C:\foo\arial.xml
  357. : File "C:\foo\arial.xml" not found&#8221;? The value for the
  358. metrics-file attribute in the user config file is actually an URL, not
  359. a file name. Use "file:///C:/foo/arial.xml" instead.
  360. </p>
  361. <p>
  362. If you used a relative URL, make sure your application has the working
  363. directory you expect. Currently FOP does not use the baseDir for
  364. resolving relative URLs pointing to font metric files.
  365. </p>
  366. <p>
  367. Try also setting the <link
  368. href="1.0/configuration.html#general-elements">font-base
  369. configuration</link>.
  370. </p>
  371. </answer>
  372. </faq>
  373. <faq id="saxexception-mismatch">
  374. <question>I get a SAXException: Mismatch: page-sequence vs. root
  375. (or similar).</question>
  376. <answer>
  377. <p>
  378. The full exception usually looks similar to this:
  379. </p>
  380. <source>Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root
  381. (http://www.w3.org/1999/XSL/Format)</source>
  382. <p>
  383. This exception is usually a follow-up error after another exception. Sometimes
  384. the original exception gets swallowed by Xalan's default <code>ErrorListener</code>
  385. (should be fixed in the latest Xalan release).
  386. </p>
  387. <p>
  388. The work-around is to set an explicit <code>ErrorListener</code> on the
  389. <code>Transformer</code>. The <code>ErrorListener</code> can be as simple as this:
  390. </p>
  391. <source><![CDATA[
  392. import javax.xml.transform.ErrorListener;
  393. import javax.xml.transform.TransformerException;
  394. public class DefaultErrorListener implements ErrorListener {
  395. public void warning(TransformerException exc) {
  396. System.err.println(exc.toString());
  397. }
  398. public void error(TransformerException exc)
  399. throws TransformerException {
  400. throw exc;
  401. }
  402. public void fatalError(TransformerException exc)
  403. throws TransformerException {
  404. throw exc;
  405. }
  406. }]]></source>
  407. </answer>
  408. </faq>
  409. <faq>
  410. <question>The following message appears after recently upgrading FOP:
  411. "I/O exception while reading font cache (org.apache.fop.fonts.EmbedFontInfo;
  412. local class incompatible: stream classdesc serialVersionUID =
  413. -9075848379822693399, local class serialVersionUID = 8755432068669997367).
  414. Discarding font cache file."</question>
  415. <answer>
  416. <p>
  417. This message is a warning that FOP failed to read from the Font cache.
  418. Which means any Font auto detection or Font directories will be re-scanned.
  419. So this failure doesn't break anything.
  420. </p>
  421. <p>
  422. To avoid the warning you can simply delete the
  423. old Font Cache file, which lives in ${base}\conf\font.cache (see <link
  424. href="1.0/configuration.html#general-elements">font-base
  425. configuration</link>).
  426. </p>
  427. </answer>
  428. </faq>
  429. </part>
  430. <part id="part-output">
  431. <title>Problems with FOP output</title>
  432. <faq id="leader-expansion">
  433. <question>Leaders don't work in current FOP. Instead of
  434. filling the line, only three dots or a short ruler is
  435. output.</question>
  436. <answer>
  437. <p>
  438. Leaders still work, in fact they work better than ever
  439. before. You'll just have to add <code>text-align="justify"</code> and/or
  440. <code>text-align-last="justify"</code> to the block with the leader. Be
  441. sure you haven't accidentally overridden the
  442. <code>leader-length.maximum="100%"</code> default value.
  443. </p>
  444. <p>
  445. Earlier versions of FOP used to expand a leader to fill the
  446. rest of the line unconditionally, anything following it,
  447. like page numbers in a TOC, was actually shifted beyond the
  448. right margin.
  449. </p>
  450. <p>
  451. The new implementation uses leader-length.optimum to
  452. determine where to break the line, and expands the leader
  453. only further if the line should be filled, as indicated by
  454. the text-align and text-align-last properties.
  455. </p>
  456. <p>
  457. Actually due to the fuzzyness of the specification both the
  458. old and the new method are conformant (although adding text
  459. after the expanded leader in the old variant never was).
  460. </p>
  461. <p>
  462. If you want to have a longer ruler or space in a
  463. non-justified line, you have to increase the
  464. leader-length.optimum property.
  465. </p>
  466. </answer>
  467. </faq>
  468. <faq id="blank-page-between-page-sequences">
  469. <question>Why does FOP insert a blank page between my page sequences?</question>
  470. <answer>
  471. <p>
  472. This is because spec conformance has been improved.
  473. </p>
  474. <p>
  475. The <link
  476. href="http://www.w3.org/TR/xsl11/#force-page-count">force-page-count
  477. property</link> controls how a FO processor pads page sequences in
  478. order to get certain page counts or last page numbers. The default is
  479. "<code>auto</code>". With this setting, if the next page sequence
  480. begins with an odd page number because you set the
  481. initial-page-number, and the current page sequence also ends with an
  482. odd page number, the processor inserts a blank page to keep odd and
  483. even page numbers alternating (similar for the case the current page
  484. sequence ends with an even page number and the next page sequence
  485. starts with an even page number).
  486. </p>
  487. <p>
  488. If you don't want to have this blank page, use
  489. <code>force-page-count="no-force"</code>.
  490. </p>
  491. </answer>
  492. </faq>
  493. <faq id="graphic-not-displayed">
  494. <question>Why is my graphic not rendered?</question>
  495. <answer>
  496. <p>Most commonly, the external file is not being found by FOP.
  497. Check the following:</p>
  498. <ul>
  499. <li>Empty or wrong baseDir setting.</li>
  500. <li>Spelling errors in the file name (including using the wrong case).</li>
  501. <li>Security Problems (i.e. the image could not be accessed
  502. because FOP is not allowed to read the file). This is
  503. especially a problem if the external file is retrieved over
  504. HTTP. Possible issues include security settings on the
  505. server, server configuration, and missing cookies or other
  506. authorization information. Any easy way to check this is to
  507. cut and paste the source URL from the <code>fo:external-graphic</code>
  508. into the Location field of a browser <strong>on the machine
  509. where the FOP process will be running</strong>.</li>
  510. </ul>
  511. <p>Other possibilities:</p>
  512. <ul>
  513. <li>The image format is not supported or not supported completely.
  514. See <link href="1.0/graphics.html">FOP Graphics Formats</link> for a
  515. list of supported formats and related issues.</li>
  516. <li>The graphic may be too large to fit into the intended space.</li>
  517. <li>There may be something (static content) that is obscuring the
  518. graphic. (This is very rare).
  519. </li>
  520. </ul>
  521. </answer>
  522. </faq>
  523. <faq id="png-fails">
  524. <question>My graphical images do not work properly.</question>
  525. <answer>
  526. <p>See <link href="1.0/graphics.html">FOP Graphics Formats</link> for a
  527. list of supported graphics formats and related issues.</p>
  528. </answer>
  529. </faq>
  530. <faq id="graphic-resolution">
  531. <question>Why is my graphic rendered at a different resolution than it was created?</question>
  532. <answer>
  533. <p>See <link href="1.0/graphics.html#resolution">Graphics Resolution</link>.</p>
  534. </answer>
  535. </faq>
  536. <faq id="keep-with">
  537. <question>Keep-with-next, keep-with-previous, keep-together
  538. don't work.</question>
  539. <answer>
  540. <p>
  541. Current FOP releases have extensive support for
  542. these properties. The current release, FOP 1.0, still supports the
  543. values "always" and "never" only, no numerical values. There may be
  544. a few places where keep-* still don't work, this should be very rare.
  545. </p>
  546. <p>
  547. The concept is called &#8220;blind table&#8221;. The table is used for
  548. pure layout reasons and is not obvious in the output.
  549. </p>
  550. <p>
  551. An example of an image and the image caption to be kept together:
  552. </p>
  553. <source><![CDATA[<fo:table table-layout="fixed" width="100%">
  554. <fo:table-column column-width="proportional-column-width(1)"/>
  555. <fo:table-body>
  556. <fo:table-row keep-with-next="always">
  557. <fo:table-cell>
  558. <fo:block>
  559. <fo:external-graphic src="foo.jpg"/>
  560. </fo:block>
  561. </fo:table-cell>
  562. </fo:table-row>
  563. <fo:table-row>
  564. <fo:table-cell>
  565. <fo:block>Image Caption</fo:block>
  566. </fo:table-cell>
  567. </fo:table-row>
  568. </fo:table-body>
  569. </fo:table>]]></source>
  570. <p>
  571. Consider upgrading to the latest version which supports keeps.
  572. </p>
  573. </answer>
  574. </faq>
  575. <faq id="table-missing">
  576. <question>My tables are missing, or missing their content.</question>
  577. <answer>
  578. <p>
  579. Check for <code>fo:table-body</code> around the rows. Usually FOP will catch this problem.
  580. </p>
  581. <p>
  582. Also, the <code>fo:table-with-caption</code> element is not implemented, tables
  583. within such an element are dropped too. FOP generates an error
  584. message for this problem. Older DocBook style sheets generate
  585. <code>fo:table-with-caption</code> elements, so watch out.
  586. </p>
  587. </answer>
  588. </faq>
  589. <faq id="cells-overflow">
  590. <question>Text overflowing table cells and the like is not clipped. Long
  591. text flows into adjacent cells/block, obscuring stuff there.</question>
  592. <answer>
  593. <p>
  594. Since the <code>overflow</code> property doesn't apply to table-cell, you
  595. can wrap the cell content in a block-container and specify
  596. <code>overflow="hidden"</code> there. Alternatively,
  597. if you have long words overflowing table cells, try to
  598. get them hyphenated. Artificial names like product identifications or
  599. long numbers usually aren't hyphenated. You can try special processing
  600. at XSLT level, like
  601. </p>
  602. <ul>
  603. <li>
  604. clip long text,
  605. </li>
  606. <li>
  607. explicit wrapping+clipping,
  608. </li>
  609. <li>
  610. insert zero width spaces (&amp;#x200B;) to allow FOP to
  611. wrap.
  612. </li>
  613. </ul>
  614. <p>
  615. Check the <link href="http://dpawson.co.uk/xsl">XSL FAQ</link> and the
  616. <link href="http://www.mulberrytech.com/xsl/xsl-list/">XSL list
  617. archive</link> for how to perform these tasks.
  618. </p>
  619. </answer>
  620. </faq>
  621. <faq id="table-cell-wrap">
  622. <question>The contents of table cells don’t wrap</question>
  623. <answer>
  624. <p>You probably have <code>keep-together="always"</code> set on the table cell. See <link
  625. href="#keep-together">next question</link>.</p>
  626. </answer>
  627. </faq>
  628. <faq id="keep-together">
  629. <question>FOP behaves differently from earlier versions when <code>keep-together="always"</code>
  630. is set on table cells</question>
  631. <answer>
  632. <p>Support for inline-level keeps has been added in FOP 0.95, and setting
  633. <code>keep-together="always"</code> also implicitly sets
  634. <code>keep-together.within-line="always"</code>, which forbids FOP
  635. to break the text into multiple lines. Set
  636. <code>keep-together.within-column="always"</code> on table-cell instead. It’s a good idea
  637. not to use the shorthand <code>keep-together="always"</code> at all!</p>
  638. </answer>
  639. </faq>
  640. <faq id="row-height-constraint">
  641. <question>FOP tells me: "The contents of row 1 are taller than they should be".
  642. What does that mean?</question>
  643. <answer>
  644. <p>
  645. This is usually caused by setting a "height" on a table-row or table-cell and when
  646. the content is higher than the specified height. By setting "height" (a so-called
  647. corresponding property) you
  648. <link href="http://www.w3.org/TR/xsl11/#d0e4413">implicitely set</link>
  649. block-progression-dimension.minimum, block-progression-dimension.optimum and
  650. block-progression-dimension.maximum to the same value. You'll get some information
  651. about that in the warning message. Look for something like:
  652. "MinOptMax[min=opt=max=14000]".
  653. </p>
  654. <p>
  655. Assuming you set the height on the table-row to 14pt and your content is 75pt high,
  656. a constraint (maximum=14pt) is violated. Normally, you just want to make sure
  657. with the "height" property that the row has a minimum height. If that is so, the
  658. right solution is to specify block-progression-dimension.minimum="14pt" instead of
  659. height="14pt".
  660. </p>
  661. </answer>
  662. </faq>
  663. <faq id="page-number-align">
  664. <question>Page numbers are not properly right aligned.</question>
  665. <answer>
  666. <p>
  667. This happens for <code>fo:page-number-citation</code> elements if the
  668. citation occurs before FOP formatted the requested page,
  669. usually in TOC or index pages. It is caused by the problem
  670. that FOP has to guess how much space the yet unknown page
  671. number will occupy, and usually the guesses are somewhat
  672. off.
  673. </p>
  674. <p>
  675. The most recent FOP releases should have this problem
  676. fixed. Check whether you can upgrade.
  677. </p>
  678. </answer>
  679. </faq>
  680. <faq id="hyphenation-fails">
  681. <question>Hyphenation does not work.</question>
  682. <answer>
  683. <p>Make sure you have set the language and optionally the country attributes for an appropriate XSL-FO element (fo:page-sequence, fo:block or fo:character):</p>
  684. <source><![CDATA[<fo:page-sequence language="fi">]]></source>
  685. <p>See <link href="1.0/hyphenation.html#support">Hyphenation Support</link> for details and instructions on using hyphenation with FOP.</p>
  686. <p>Explicitly enable hyphenation for an appropriate XSL-FO element (fo:block, fo:character):</p>
  687. <source><![CDATA[<fo:block hyphenate="true">]]></source>
  688. </answer>
  689. </faq>
  690. <faq id="indent-inheritance">
  691. <question>When I use margins, my content in a nested table or block-containers gets indented twice. Is this a bug?</question>
  692. <answer>
  693. <p>
  694. No, although you might easily think so. The problem has to do
  695. with property inheritance of the start-indent and end-indent
  696. properties to which the margin properties are mapped. Apache
  697. FOP strictly adheres to the XSL-FO specification here which many
  698. other commercial FO implementations don't do to better meet end-user
  699. expectations. You can make FOP behave like these if you set
  700. <code>setBreakIndentInheritanceOnReferenceAreaBoundary(true)</code>
  701. on the FOUserAgent. The better way is to reset <code>start-indent</code>
  702. and <code>end-indent</code> to "0pt" on table-body or block-container.
  703. For further details, please consult the
  704. <link href="http://wiki.apache.org/xmlgraphics-fop/IndentInheritance">Wiki page on Indent Inheritance</link>.
  705. </p>
  706. </answer>
  707. </faq>
  708. <faq id="pdf-ps-java2d-differences">
  709. <question>Why is the output of Java2D/AWT-based renderers different than, for example, PDF or PS?</question>
  710. <answer>
  711. <p>
  712. If you render the same document once to a PNG or TIFF and once into a PDF, the output
  713. may not be the same, i.e. line breaks are different or lines may have different heights.
  714. The reason for this: The Java2D-based renderers use the font subsystem of Java2D/AWT. The
  715. PDF and PS renderers use FOP's own font subsystem which provides much better font metrics
  716. than Java2D. These can lead to different layout decisions when the same document is
  717. rendered with different renderers. An alternative approach to fix this problem might be
  718. available but it hasn't been tested, yet. See also the
  719. <link href="1.0/output.html#general-fonts">notes on fonts in the various output formats</link>.
  720. </p>
  721. </answer>
  722. </faq>
  723. </part>
  724. <part id="part-embedding">
  725. <title>Embedding FOP. Using FOP in a servlet.</title>
  726. <faq id="servlet">
  727. <question>How do I use FOP in a servlet?</question>
  728. <answer>
  729. <p>
  730. See <link href="1.0/servlets.html">Using FOP in a Servlet</link>.
  731. </p>
  732. </answer>
  733. </faq>
  734. <faq id="servlet-with-xslt">
  735. <question>How do I use FOP in a servlet with an XSLT
  736. transformation?</question>
  737. <answer>
  738. <p>
  739. See <link href="1.0/servlets.html#xslt">Using FOP in a Servlet with XSLT Transformation</link>.
  740. </p>
  741. </answer>
  742. </faq>
  743. <faq id="servlet-xslt-params">
  744. <question>How do I pass parameters to the XSLT transformation?</question>
  745. <answer>
  746. <p>
  747. See <link href="1.0/servlets.html#xslt">Using FOP in a Servlet with XSLT Transformation</link>.
  748. </p>
  749. </answer>
  750. </faq>
  751. <faq id="servlet-nonstd-fonts">
  752. <question>How do I use my own fonts when running FOP from a servlet?</question>
  753. <answer>
  754. <p>
  755. Declare the fonts in the <code>userconfig.xml</code> file as usual.
  756. See <link href="#usercfg">loading the user configuration file</link>
  757. for further details.
  758. </p>
  759. </answer>
  760. </faq>
  761. <faq id="servlet-baseDir">
  762. <question>How do I set the baseDir property in a servlet environment?</question>
  763. <answer>
  764. <p>
  765. See <link href="1.0/embedding.html#config-internal">Setting the Configuration Programmatically</link>.
  766. </p>
  767. </answer>
  768. </faq>
  769. <faq id="usercfg">
  770. <question>How do I use a user configuration file from a servlet?</question>
  771. <answer>
  772. <p>
  773. See <link href="1.0/embedding.html#config-external">Using a Configuration File in an Embedded App</link>.
  774. </p>
  775. </answer>
  776. </faq>
  777. <faq id="servlet-NoClassDefFound">
  778. <question>I keep getting NoClassDefFound and other exceptions. How do I
  779. get FOP working for various servlet engines?</question>
  780. <answer>
  781. <p>
  782. See <link href="1.0/servlets.html#servlet-engine">Servlet Engines</link>.
  783. </p>
  784. </answer>
  785. </faq>
  786. <faq id="multithreaded">
  787. <question>Can FOP be used in multithreaded environments?</question>
  788. <answer>
  789. <p>
  790. See <link href="1.0/embedding.html#multithreading">Multithreading FOP</link>.
  791. </p>
  792. </answer>
  793. </faq>
  794. </part>
  795. <part id="part-svg">
  796. <title>SVG specific questions</title>
  797. <faq id="svg-text">
  798. <question>The rendering of SVG text in my PDF is of poor quality.
  799. Can I control this?</question>
  800. <answer>
  801. <p>See <link href="1.0/graphics.html#svg-pdf-text">Placing SVG Text into PDF</link>.</p>
  802. </answer>
  803. </faq>
  804. <faq id="svg-headless">
  805. <question>How do I use FOP with SVG on headless servers?</question>
  806. <answer>
  807. <p>See <link href="1.0/graphics.html#batik">FOP: Graphics (Batik)</link>.</p>
  808. </answer>
  809. </faq>
  810. <faq id="svghangs">
  811. <question>FOP does not exit if a SVG is included.</question>
  812. <answer>
  813. <p>
  814. Applies to older FOP versions and JDK 1.3 and older. That's because
  815. there is an AWT thread hanging around. The solution is to put a
  816. System.exit(0) somewhere.
  817. </p>
  818. </answer>
  819. </faq>
  820. <faq id="svg-url">
  821. <question>I have problems with SVG referring to gradients etc. using
  822. "uri(#stuff)". I get a MalformedURLException.</question>
  823. <answer>
  824. <p>
  825. This is really a "resolving relative URI" problem with some
  826. twists. The problem is that the <code>#stuff</code> URL fragment
  827. identifier is resolved within the current SVG document. So the
  828. reference must be valid within the XML subset and it cannot
  829. reference other SVG documents in the same XML file. Some options
  830. to try:
  831. </p>
  832. <ul>
  833. <li>
  834. Put the SVG into a separate file and use it with
  835. fo:external-graphics.
  836. </li>
  837. <li>
  838. Use a separate SVG file which contains only the gradient (and
  839. perhaps other SVG stuff you want to reference) and point an absolute
  840. URL to it:
  841. <code>fill="url(file:///c:/refstuff/grad.svg#PurpleToWhite)"</code>.
  842. </li>
  843. <li>
  844. Same as above but use a relative URL:
  845. <code>fill="url(grad.svg#PurpleToWhite)"</code>. This may be easier
  846. to deploy.
  847. </li>
  848. <li>
  849. Make sure that the reference is valid in the current SVG document.
  850. </li>
  851. </ul>
  852. <p>
  853. In any case, the referenced stuff has to be pointed to by an URL. It
  854. doesn't necessarily have to be a file URL, HTTP should also
  855. work. Also, expect a performance hit in all cases, because another XML
  856. file has to be retrieved and parsed.
  857. </p>
  858. <p>
  859. Ultimately, both FOP and especially Batik should be fixed to make
  860. your code work as expected, but this will not only take some time
  861. but also some effort by a standard committee in order to make the
  862. semantics of this kind of references in embedded SVG clearer.
  863. </p>
  864. <p>See also <link href="#MalformedURL">MalformedURLException</link></p>
  865. </answer>
  866. </faq>
  867. <faq id="svg-scaling">
  868. <question>Why is my SVG rendered at a size different from that specified in my fo:external-graphic element?</question>
  869. <answer>
  870. <p>See <link href="1.0/graphics.html#svg-scaling">SVG Scaling</link>.</p>
  871. </answer>
  872. </faq>
  873. <faq id="svg-attribute-required">
  874. <question>FOP fails with something like "The attribute "width" of the element &lt;rect&gt; is required". What's wrong?</question>
  875. <answer>
  876. <p>
  877. This phenomenon is not a
  878. bug in FOP, but rather in the dependent packages: Apache Batik, Apache Xalan-J and SAXON. The bug in Apache Batik will be
  879. fixed in the next release. In the latest release of Apache Xalan-J, the bug is already fixed. It only occurs in the Xalan
  880. version bundled with Sun's JVM, because Sun uses a rather old version.
  881. </p>
  882. <p>
  883. Bug description: In a namespace-enabled Level 3 DOM, an attribute in the default namespace must be set with
  884. <code>"null"</code> as the value for the namespace URI. SAX, on the other side, uses an empty string ("") to designate
  885. the default namespace. Many packages appear to not properly handle this difference in which case they still use the empty
  886. string as the namespace URI parameter for <code>org.w3c.dom.Element.setAttributeNS()</code>.
  887. </p>
  888. <p>
  889. Work-around: Use the latest version of Apache Xalan-J. Note that starting with JDK 1.4 it's not enough to replace Xalan-J
  890. on the normal application classpath and you need to override the Xalan-J version bundled with the Sun JVM using the
  891. <link href="http://java.sun.com/j2se/1.4.2/docs/guide/standards/">Endorsed Standards Override Mechanism</link>, i.e.
  892. you must place Xalan-J in the <code>"lib/endorsed"</code> directory of your JRE.
  893. </p>
  894. </answer>
  895. </faq>
  896. </part>
  897. <part id="part-pdf">
  898. <title>PDF specific (includes Acrobat peculiarities)</title>
  899. <faq id="pdf-embed-font">
  900. <question>How do I embed fonts in PDF?</question>
  901. <answer>
  902. <p>
  903. See the <link href="1.0/fonts.html">Fonts</link> page for information
  904. about embedding fonts.
  905. </p>
  906. </answer>
  907. </faq>
  908. <faq id="pdf-characters">
  909. <question>Some characters are not displayed, or displayed incorrectly, or
  910. displayed as &#8220;#&#8221;.</question>
  911. <answer>
  912. <p>
  913. This usually means the selected font doesn't have a glyph
  914. for the character.
  915. </p>
  916. <p>
  917. The standard text fonts supplied with Acrobat Reader have
  918. mostly glyphs for characters from the ISO Latin 1 character
  919. set. For a variety of reasons, even those are not completely
  920. guaranteed to work, for example you can't use the fi
  921. ligature from the standard serif font. Check the <link
  922. href="1.0/output.html#pdf-fonts">overview</link> for the default
  923. PDF fonts.
  924. </p>
  925. <p>
  926. If you use your own fonts, the font must have a glyph for
  927. the desired character. Furthermore the font must be
  928. available on the machine where the PDF is viewed or it must
  929. have been embedded in the PDF file. See <link
  930. href="1.0/fonts.html">embedding fonts</link>.
  931. </p>
  932. <p>
  933. For most symbols, it is better to select the symbol font
  934. explicitely, for example in order to get the symbol for the
  935. mathematical empty set, write:
  936. </p>
  937. <source><![CDATA[<fo:inline font-family="Symbol">&#x2205;</fo:inline>]]></source>
  938. <p>
  939. The "#" shows up if the selected font does not define a glyph for the
  940. required character, for example if you try:
  941. </p>
  942. <source><![CDATA[<fo:inline font-family="Helvetica">&#x2205;</fo:inline>]]></source>
  943. </answer>
  944. </faq>
  945. <faq id="pdf-postprocess">
  946. <question>What tools are available for post-processing my PDF document?</question>
  947. <answer>
  948. <p>See <link href="1.0/output.html#pdf-postprocess">PDF Post-processing</link>.</p>
  949. </answer>
  950. </faq>
  951. <faq id="pdf-security">
  952. <question>How do I add security features (encryption, disable printing)
  953. to my PDF document?</question>
  954. <answer>
  955. <p>
  956. See <link href="1.0/pdfencryption.html">PDF Encryption</link>.
  957. See also <link href="1.0/output.html#pdf-postprocess">PDF Post-processing</link>.
  958. </p>
  959. </answer>
  960. </faq>
  961. <faq id="pdf-doc-properties">
  962. <question>How do I add document properties (title, author, etc.) to my
  963. PDF document?</question>
  964. <answer>
  965. <p>See <link href="1.0/metadata.html">Metadata</link>.</p>
  966. </answer>
  967. </faq>
  968. <faq id="pdf-watermark">
  969. <question>How do I add watermarks to my PDF document?</question>
  970. <answer>
  971. <p>See <link href="1.0/output.html#pdf-watermark">PDF Watermarks</link>.</p>
  972. </answer>
  973. </faq>
  974. <faq id="pdf-print-contortion">
  975. <question>The PDF is printed contorted!</question>
  976. <answer>
  977. <p>
  978. Check the paper size in Acrobat settings and the "fit to page" print
  979. setting. Contorted printing is often caused by a mismatched paper
  980. format, for example if the setting is "US Letter" but the PDF was
  981. made for A4. Sometimes also the printer driver interferes, check its
  982. settings too.
  983. </p>
  984. </answer>
  985. </faq>
  986. <faq id="pdf-bookmark-display">
  987. <question>How do I control the Acrobat bookmark display?</question>
  988. <answer>
  989. <p>
  990. FOP supports the starting-state property of the XSL 1.1
  991. <link href="http://www.w3.org/TR/xsl11/#fo_bookmark">fo:bookmark</link>
  992. element which can be used for this. The color, font-style and
  993. font-weight properties on
  994. <link href="http://www.w3.org/TR/xsl11/#fo_bookmark-title">fo:bookmark-title</link>
  995. are not yet supported, though.
  996. </p>
  997. </answer>
  998. </faq>
  999. <faq id="acrobat-anti-aliasing">
  1000. <question>How can I get rid of strange single-pixel lines inside table borders or between table cells in Adobe Acrobat?</question>
  1001. <answer>
  1002. <p>
  1003. Since Apache FOP supports the collapsed border model, every border segment consists
  1004. of two separate shapes. This is due to the fact that each side of the border
  1005. segment can have a different color. Now, Adobe Acrobat may display thin (1 pixel wide)
  1006. lines inside the border segment or sometimes even between to adjacent
  1007. colored rectangles making up the background of a block or table cell.
  1008. This effect is due to the way Adobe Acrobat does anti-aliasing. Adobe's algorithm
  1009. seems to cause these artifacts. Other PDF viewers don't have that problem. Or at least
  1010. we haven't had any reports in that direction.
  1011. </p>
  1012. <p>
  1013. First of all, these artifacts do not appear in print since no anti-aliasing is done
  1014. by Adobe Acrobat in this case (except maybe if you tell Acrobat to print the page
  1015. as a bitmap in which case Adobe fully composes the page itself). So, if the artifacts appear
  1016. on screen, it doesn't mean they have to appear in print, too.
  1017. </p>
  1018. <p>
  1019. To get rid of the artifacts, you can call up the "Preferences" dialog of
  1020. Adobe Acrobat and select the tab "Page display". Enabling "Enhance thin lines"
  1021. may help in some situations. Otherwise, you can disable "Smooth line art".
  1022. You may have to disable "Use 2D graphics acceleration", too, so you can disable
  1023. "Smooth line art" in the first place.
  1024. </p>
  1025. <p>
  1026. Here an example of how the effect can look like (left: anti-aliasing on, right: anti-aliasing off):
  1027. </p>
  1028. <figure src="images/acrobat-anti-aliasing-artifacts.png" alt="Left: anti-aliasing on, Right: off"/>
  1029. <p>
  1030. Unfortunately, it is not possible to control the above settings from within the PDF file.
  1031. The user has to change these settings himself. Improving FOP to avoid this kind of problem
  1032. would be possible although rather hard to achieve because we'd need to add a considerable
  1033. amount of code to combine the various line segments. Something like that has been tried already
  1034. years ago showing that this is a tricky task. Also, the improvement may not justify the amount
  1035. of effort required.
  1036. </p>
  1037. </answer>
  1038. </faq>
  1039. </part>
  1040. <part id="part-iex">
  1041. <title>IEx specific stuff</title>
  1042. <faq id="iex-servlet-multiple">
  1043. <question>The FOP servlet is called multiple times!</question>
  1044. <answer>
  1045. <p>
  1046. This is a problem of Internet Explorer requesting the content several
  1047. times. Please see the <link href="1.0/servlets.html#ie">notes on Internet Explorer</link>
  1048. for more information.
  1049. </p>
  1050. </answer>
  1051. </faq>
  1052. <faq id="iex-pdf-print-from-browser">
  1053. <question>How do I print PDF directly from the browser?</question>
  1054. <answer>
  1055. <p>
  1056. It depends whether you mean "printing to a printer under control of
  1057. the server" or "printing on the client's printer".
  1058. </p>
  1059. <p>
  1060. For the first problem, look at the print servlet in the FOP
  1061. examples. You'll have to gather any printer settings in a HTML form
  1062. and send it to the server.
  1063. </p>
  1064. <p>
  1065. For the second task, you can use some client side script to start
  1066. Acrobat Reader in print mode, or use a Java applet based on the FOP
  1067. print servlet. This depends heavily on the client installation and
  1068. should not be relied on except in tightly controlled environments.
  1069. </p>
  1070. <p>
  1071. See also <link href="http://marc.theaimsgroup.com/?l=fop-dev&amp;m=101065988325115&amp;w=2">http://marc.theaimsgroup.com/?l=fop-dev&amp;m=101065988325115&amp;w=2</link>
  1072. </p>
  1073. </answer>
  1074. </faq>
  1075. </part>
  1076. <part id="part-input">
  1077. <title>General questions regarding XSLT, XSLFO, and basic XML</title>
  1078. <faq id="fo-center">
  1079. <question>(FO) How do I vertically center an image or a table (or
  1080. whatever)?</question>
  1081. <answer>
  1082. <p>
  1083. See <link href="fo.html#fo-center-vertical">XSL-FO Vertical Centering</link>.
  1084. </p>
  1085. </answer>
  1086. </faq>
  1087. <faq id="fo-center-table-horizon">
  1088. <question>(FO) How do I center a table horizontally?</question>
  1089. <answer>
  1090. <p>
  1091. See <link href="fo.html#fo-center-table-horizon">XSL-FO Horizontal Centering (Tables)</link>.
  1092. </p>
  1093. </answer>
  1094. </faq>
  1095. <faq id="fo-page-outer">
  1096. <question>(FO) How to get page numbers printed on the "outer side" of the
  1097. page (for books, for example)?</question>
  1098. <answer>
  1099. <p>
  1100. See <link href="fo.html#fo-oddeven">Recto/Verso Static Content Differences</link>.
  1101. </p>
  1102. </answer>
  1103. </faq>
  1104. <faq id="oddeven">
  1105. <question>(FO) How do I use different static content for odd and even
  1106. pages?</question>
  1107. <answer>
  1108. <p>
  1109. See <link href="fo.html#fo-oddeven">Recto/Verso Static Content Differences</link>.
  1110. </p>
  1111. </answer>
  1112. </faq>
  1113. <faq id="fo-first-page-header">
  1114. <question>(FO) How do I get a special header on the first page?</question>
  1115. <answer>
  1116. <p>
  1117. See <link href="fo.html#fo-first-page">Making the First Page Special</link>.
  1118. </p>
  1119. </answer>
  1120. </faq>
  1121. <faq id="fo-omit-headers">
  1122. <question>(FO) How do I omit my headers on a blank page? How do I write
  1123. "This page is left blank" on an intentionally blank page?</question>
  1124. <answer>
  1125. <p>
  1126. See <link href="fo.html#fo-blank-pages">Blank Pages</link>.
  1127. </p>
  1128. </answer>
  1129. </faq>
  1130. <faq id="fo-special-symbols">
  1131. <question>(FO) How do I print an Euro sign, a checkbox or other some other
  1132. special symbols?</question>
  1133. <answer>
  1134. <p>
  1135. See <link href="fo.html#xml-special-chars">Special Characters</link>.
  1136. </p>
  1137. </answer>
  1138. </faq>
  1139. <faq id="fo-preformat">
  1140. <question>(FO) How do I keep linebreaks and hard spaces? How do I get
  1141. preformatted text displayed as expected?</question>
  1142. <answer>
  1143. <p>
  1144. See <link href="fo.html#fo-preformat">Preformatting Content</link>.
  1145. </p>
  1146. </answer>
  1147. </faq>
  1148. <faq id="fo-total-pages">
  1149. <question>(FO) How do I print the total number of pages, for example "page 1
  1150. of 12"</question>
  1151. <answer>
  1152. <p>
  1153. See <link href="fo.html#fo-total-pages">Total Document Pages</link>.
  1154. </p>
  1155. </answer>
  1156. </faq>
  1157. <faq id="fo-region-overlap">
  1158. <question>(FO) The header overlaps body content. The body extends into
  1159. the footer.</question>
  1160. <answer>
  1161. <p>
  1162. See <link href="fo.html#fo-region-align">Aligning Regions</link>.
  1163. </p>
  1164. </answer>
  1165. </faq>
  1166. <faq id="fo-lines">
  1167. <question>(FO) How do I get lines in the document, as separators, side
  1168. bars or folding marks?</question>
  1169. <answer>
  1170. <p>
  1171. See <link href="fo.html#fo-lines">Drawing Lines</link>.
  1172. </p>
  1173. </answer>
  1174. </faq>
  1175. <faq id="fo-validate">
  1176. <question>(FO) How do I validate my FO document?</question>
  1177. <answer>
  1178. <p>
  1179. See <link href="fo.html#fo-validate">Validating XSL-FO</link>.
  1180. </p>
  1181. </answer>
  1182. </faq>
  1183. <faq id="xml-non-breaking-space">
  1184. <question>(XML) How do I get a non-breaking space in FO? There are complaints about <code>&amp;nbsp;</code>.</question>
  1185. <answer>
  1186. <p>
  1187. See <link href="fo.html#xml-special-chars">XML Special Characters</link>.
  1188. </p>
  1189. </answer>
  1190. </faq>
  1191. <faq id="xml-undefined-entities">
  1192. <question>(XML) How do I enter special characters in XML? There are complaints about undefined entities, such as <code>&amp;uuml;</code>, which work in HTML. </question>
  1193. <answer>
  1194. <p>
  1195. See <link href="fo.html#xml-special-chars">XML Special Characters</link>.
  1196. </p>
  1197. </answer>
  1198. </faq>
  1199. <faq id="xml-illegal-entities">
  1200. <question>(XML) There are complaints about illegal characters and entities
  1201. in the input.</question>
  1202. <answer>
  1203. <p>
  1204. See <link href="fo.html#xml-entity-chars">Using HTML Character Names</link>.
  1205. </p>
  1206. </answer>
  1207. </faq>
  1208. <faq id="xml-illegal-chars">
  1209. <question>(XML) There are complaints about illegal bytes or characters in
  1210. the input. There are odd characters in the result.</question>
  1211. <answer>
  1212. <p>
  1213. See <link href="fo.html#xml-encoding">XML Encoding Issues</link>.
  1214. </p>
  1215. </answer>
  1216. </faq>
  1217. <faq id="xslt-current-date">
  1218. <question>(XSLT) How can I use the current date and time in my document?</question>
  1219. <answer>
  1220. <p>See <link href="fo.html#xslt-date">Current Date and Time</link>.</p>
  1221. </answer>
  1222. </faq>
  1223. <faq id="xhtml-to-pdf">
  1224. <question>Can I use FOP to convert XHTML or HTML files to PDF?</question>
  1225. <answer>
  1226. <p>
  1227. You will get better results if you transform your source
  1228. XML directly into XSLFO. It is tempting to use the
  1229. XML-&gt;XHTML-&gt;XSLFO approach, because this apparently means
  1230. there's only one transformation to maintain, but XHTML
  1231. and publishing grade PDF are dissimilar enough that an
  1232. "generic" XHTML-&gt;XSLFO(PDF) usually wont cut it, because
  1233. the XHTML already lacks information from the original XML.
  1234. It may be worthwhile to go from the source XML to an
  1235. intermediate custom XML which on one hand is close enough
  1236. to representation to allow simple transformation to either
  1237. XHTML or XSLFO for most of the structure, but on the other
  1238. hand retains enough semantic from the original XML that
  1239. elements which must be handled differently in the two
  1240. representations can be handled differently. Setting this
  1241. up requires experience and most likely extensive prototyping.
  1242. </p>
  1243. </answer>
  1244. </faq>
  1245. <faq id="xhtml-to-pdf2">
  1246. <question>I know it may be a bad idea to use FOP to convert XHTML or HTML files to PDF, but I want to do it anyway. Are there any tools available to help me?</question>
  1247. <answer>
  1248. <p>
  1249. The <link href="resources.html">FOP Resources page</link> has links
  1250. to a tool called <link href="http://html2fo.sourceforge.net/">html2fo</link>
  1251. which can be used to make such a transformation. In addition, there
  1252. are tools on the Antenna House <link href="http://www.antennahouse.com/XSLsample/XSLsample.htm">XSL-FO Tutorial and Sample</link>
  1253. page.
  1254. </p>
  1255. </answer>
  1256. </faq>
  1257. </part>
  1258. <part id="dev-help">
  1259. <title>Development-related Questions.</title>
  1260. <faq id="doc-mgt">
  1261. <question>Where can I learn how the FOP docs and web site are built?</question>
  1262. <answer>
  1263. <p>
  1264. See FOP <link href="dev/doc.html">Doc Management</link>.
  1265. </p>
  1266. </answer>
  1267. </faq>
  1268. </part>
  1269. <part id="part-help">
  1270. <title>General suggestions. How to solve problems.</title>
  1271. <faq id="bugs">
  1272. <question>I think I have found a bug in FOP. What should I do?</question>
  1273. <answer>
  1274. <p>
  1275. See <link href="bugs.html">the Bugs page</link> for information about
  1276. bugs already reported and how to report new ones.
  1277. </p>
  1278. </answer>
  1279. </faq>
  1280. <faq id="postquestions">
  1281. <question>I have questions that are not addressed in this FAQ. Where
  1282. should I post them?</question>
  1283. <answer>
  1284. <ul>
  1285. <li>If your question is a development-related question, please see the <link href="dev/faq.html">Developer FAQs</link>.</li>
  1286. <li>
  1287. If you have a runtime exception or other runtime problem:
  1288. <ul>
  1289. <li>
  1290. Double check the <link href="#part-running">Runtime FAQs</link>.
  1291. </li>
  1292. <li>
  1293. ClassNotFoundException, NoSuchMethodException and
  1294. NoSuchFieldException problems are almost always a problem with
  1295. the local environment. Try to get local help first.
  1296. </li>
  1297. <li>
  1298. Check <link href="bugs.html#issues_existing">Reported Issues</link>
  1299. to see if this is a known problem.
  1300. </li>
  1301. <li>If none of the above apply, post a question to the fop-dev
  1302. mailing list.
  1303. </li>
  1304. </ul>
  1305. </li>
  1306. <li>
  1307. In the case where something works properly with another formatter,
  1308. (e.g., AntennaHouse, PassiveTex, etc.) but doesn't work with FOP, please
  1309. check the <!--link href="relnotes.html"-->Release Notes<!--/link-->, the
  1310. <link href="compliance.html">FOP Standards Compliance</link> document,
  1311. and the remaining FAQ in this document. If not found there, look at the
  1312. list of <link href="bugs.html#issues_existing">Bugs Already Reported</link>.
  1313. If not found there, please post a question on the fop-user mailing list
  1314. or <link href="bugs.html#issues_new">Open a New Bug</link>.
  1315. </li>
  1316. <li>
  1317. Question about how to use FOP, how to perform certain tasks with FOP
  1318. or how to integrate FOP into another application should be posted to
  1319. fop-user.
  1320. </li>
  1321. <li>
  1322. XSLT specific stuff sould go to the <link
  1323. href="http://www.mulberrytech.com/xsl/xsl-list/">XSL
  1324. list</link>. This includes problems with the language and XSLT
  1325. HOW-TOs.
  1326. </li>
  1327. <li>
  1328. Problems specific to a certain XSLT processor, like Xalan, Saxon or
  1329. MSXML, should be handled by processor specific lists. This includes
  1330. problems with deployment, processor specific extensions, suspected
  1331. bugs and processor specific APIs. Note that JDK 1.4 and later come with an
  1332. XML parser and an XSLT processor which may be the source of the problem.
  1333. </li>
  1334. <li>
  1335. Problems with servlet containers should be asked on the vendor
  1336. specific lists for these software packages.
  1337. </li>
  1338. <li>
  1339. More general questions regarding Java, including deployment, Java
  1340. APIs, classpath issues and property definitions should be redirected
  1341. to an appropriate Java specific list.
  1342. </li>
  1343. </ul>
  1344. </answer>
  1345. </faq>
  1346. </part>
  1347. </faqs>