From: Joerg Pietschmann
XSLFO is an XML vocabulary that is used to specify a pagination and
- other styling for page layout output. The acronym “FO” stands for
+ other styling for page layout output. The acronym “FO”
+ stands for
Formatting Objects. XSLFO can be
- used in conjunction with
XSLT describes the transformation of arbitrary XML input into other
- XML (like XSLFO), HTML or plain text. The “T” comes from
+ XML (like XSLFO), HTML or plain text. The “T” comes from
Transformation. For historical reasons, a
- transformation is often also called a “style sheet”.
+ transformation is often also called a “style sheet”.
Synonyms: XSL transformation, XSL:T, XSL style sheet.
@@ -147,9 +148,10 @@
- The Jimi image library, which is used for processing images in PNG and
- other formats, was removed from the distribution for licensing
- reasons. You have to This is typically a problem with your classpath.
+ This is typically a problem with your classpath. If you are running FOP from the command line:
There are also some bugs which cause FOP to go into an nonterminating
@@ -281,10 +287,10 @@
resolving process, which transforms it into an absolute
URL.
+
- You may find it helpful to use the validation tools to validate your -FO document. This will catch most problems, but should not be relied upon to catch all. + You may find it helpful to use the validation tools to validate your + FO document. This will catch most problems, but should not be + relied upon to catch all.
If you use XSLT, problems in your style sheet and in your source XML @@ -368,22 +376,22 @@ FO document. This will catch most problems, but should not be relied upon to cat Relative URLs are resolved against the baseDir property of FOP. For the command line FOP application, the baseDir is the directory of the input file, either the FO file or the XML source. If FOP is used - embedded in a servlet, baseDir can be set explicitely. If - it's not set, it is usually the current working directory of the - process which runs FOP. + embedded in a servlet, baseDir can be + set explicitely. If it's not set, it is usually the current + working directory of the process which runs FOP.
-
+
- Did you get: «Failed to read font metrics file C:\foo\arial.xml
- : File "C:\foo\arial.xml" not found»? The value for the
+ Did you get: «Failed to read font metrics file C:\foo\arial.xml
+ : File "C:\foo\arial.xml" not found²? The value for the
metrics-file attribute in the user config file is actually an URL, not
a file name. Use "file:///C:/foo/arial.xml" instead.
- These properties are not implemented, except for keep-with-next and
- keep-with-previous on table rows. In order to take advantage of them,
- you have to nest stuff to be kept together in a table.
+ These properties are not implemented, except on table rows. In
+ order to take advantage of them, you have to nest stuff to be
+ kept together in a table.
- The concept is called “blind table”. The table is used for
+ The concept is called “blind table”. The table is used for
pure layout reasons and not obvious in the output.
@@ -494,7 +502,19 @@ FO document. This will catch most problems, but should not be relied upon to cat
- Several possibilities:
+ The most common reason is that the file is not found because
+ of an empty or wrong baseDir setting, spelling errors in the
+ file name, in particular using the wrong case, or, if the
+ image is retrieved over HTTP, the image was not delivered because
+ of security settings in the server, missing cookies or other
+ authorization information or other server misconfigurations.
+ One way to check this is to cut&paste the source URL
+ from the fo:external-graphic into the Location field of
+ a browser on the machine where the FOP process
+ will be running.
+
+ Several other possibilities:
+
-
- Please look into Howto embed FOP in a servlet for all - kinds of details. + Please look into Embedding FOP + for all kinds of details.
@@ -793,8 +813,8 @@ transformer.transform(xmlsource, new SAXResult(driver.getContentHandler()));This is really a "resolving relative URI" problem with some @@ -852,40 +872,109 @@ transformer.transform(xmlsource, new SAXResult(driver.getContentHandler()));
Answers are that fonts must be available for the output format, and - the selected font must contain glyphs for the desired character. -PDF has a set of defined fonts, other fonts can be embedded following the -instructions. -To find out if the characters you need are in the core fonts then -(todo - find a glyph font table for the fonts). -
-For example, for most symbols, the symbol font has to be selected - explicitely (in future it should be possible to specify a list of fonts -where it will select the font for the specified character): -
-<fo:inline font-family="Symbol">∅</fo:inline>
-gives EMPTY SET while the same characters in the default font results - in AE LIGATURE (which happens to occupy the same place in the default - font as the EMPTY SET in the Symbol font). The "#" shows up if the - selected font does not define a glyph for the translated index.
++ There are a few fonts supplied with Acrobat Reader. If you use other + fonts, the font must be available on the machine where the PDF is + viewed or it must have been embedded in the PDF file. See + embedding fonts. +
++ Furthermore, if you select a certain font family, the font must + contain glyphs for the desired character. There is an overview available for the + default PDF fonts. For most symbols, it is better to select the symbol + font explicitely, for example in order to get the symbol for the + mathematical empty set, write: +
+ ++ The "#" shows up if the selected font does not define a glyph for the + required character, for example if you try: +
+FOP does not currently support this feature. Possible workarounds include those mentioned in the PDF Post-Processing FAQ.
++ FOP does not currently support this feature. Possible workarounds + include those mentioned in the PDF + Post-Processing FAQ. +
++ Some sample code for encrypting a FOP generated PDF with iText to + get you started: +
+ ++ Check the iText tutorial and documentation for setting access flags, + password, encryption strength and other parameters. +
FOP does not currently support this feature. Possible workarounds:
Check paper size in Acrobat settings and "fit to page" (or something)
-Not possible with FOP. Postprocess the PDF.
++ Check the paper size in Acrobat settings and the "fit to page" print + setting. Contorted printing is often caused by a mismatched paper + format, for example if the setting is "US Letter" but the PDF was made + for A4. + Sometimes also the printer driver interferes, check its settings + too. +
see #later
++ FOP does not currently support this feature. Possible workarounds + include those mentioned in the PDF + Post-Processing FAQ. +
.pdf
, like
+ Use an URL ending in .pdf
, like
http://myserver/servlet/stuff.pdf
. Yes, the servlet can
be configured to handle this. If the URL has to contain parameters,
try to have both the base URL as well as the last parameter end in
@@ -966,7 +1074,7 @@ where it will select the font for the specified character):
For the first problem, look at the print servlet in the FOP - examples. You'll have to gather any printer settings in an HTML form + examples. You'll have to gather any printer settings in a HTML form and send it to the server.
@@ -1196,21 +1304,35 @@ where it will select the font for the specified character):
- Try to look it up in the Unicode reference at the Unicode Consortium, in particular search the reference by - name. Use . +
++ Use XML character references to put the character into your source XML, XSLT or FO.
- Watch out for font traps, see #, change font temporarily using - fo:inline if necessary. + For example, the following will result in an Euro sign: +
+ ++ The selected font family must have a glyph for the character you want + to show. This is actually a somewhat tricky issue, especially for + symbol characters. +
++ Some environments provide also a character table utility (like Win2K + or WinXP), which can also help you to get an idea what glyphs are + available in a certain font.
Alternative: Use an embedded graphic: GIF, PNG, SVG, whatever. @@ -1218,8 +1340,8 @@ where it will select the font for the specified character):
The specification provides some properties for this:
- (XSL FAQ) + This is an XSL FAQ.
Put an empty block with an id at the end of the flow:
+]]>Get the number of the last page as follows:
@@ -1310,7 +1432,7 @@ class rendtest {
Contrary to popular opinion, the regions on a page may overlap.
@@ -1355,13 +1477,26 @@ class rendtest {
RenderX has provided an Unofficial DTD for FO Documents. This document may be helpful in validating general FO issues. FOP also maintains an Unofficial FOP Schema in the FOP CVS Repository. This document can be used either to validate against the FO standard, or against the actual FOP implementation. See the notes near the beginning of the document for instructions on how to use it.
+ RenderX has provided an
+ Unofficial
+ DTD for FO Documents. This document may be helpful in
+ validating general FO issues.
+
+ FOP also maintains an Unofficial
+ FOP Schema in the FOP CVS Repository. This document can be
+ used either to validate against the FO standard, or against the
+ actual FOP implementation. See the notes near the beginning of the
+ document for instructions on how to use it.
+
Use   everywhere. In your own XML, you could also use a DTD
@@ -1371,8 +1506,8 @@ class rendtest {
Don't use names as in HTML, use numbers (unless you have a DTD which
@@ -1397,7 +1532,8 @@ class rendtest {
offending characters.
- Refer to the XML specification or to a good tutorial for
+ Refer to the XML
+ specification or to a good tutorial for
details of the XML file format.
. How
+ do I get a non-breaking space in FO?ü
which used to work in HTML. How do I enter
+ special characters like in HTML?
- See docs. See also
DPI - This is an important issue when creating output for printing. @@ -51,13 +51,13 @@ images and the rendering of certain graphics in the output. Currently FOP uses a value of 72dpi.
-You may want to send your output directly to a printer. The Print -renderer uses the java api to print the document or you might be +You may want to send your output directly to a printer. The print +renderer can use the Java API to print the document. You might also be able to send the output stream directly to a printer. If your printer supports postscript you could send the postscript to the printer. If you have a printer that supports PCL you could stream the PCL document to your printer. -On Windows: +On Windows, you can use:
@@ -66,8 +66,8 @@ On UNIX:
-And give the OutputStream (out) to the PCLRenderer and it happily sends the -PCL to the AIX print queue. +Set the OutputStream (out) to the PCLRenderer and it happily sends the +PCL to the UNIX printer queue.