<menu-item label="Fonts" href="fonts.html"/>
</menu>
<menu label="Developers">
+ <external label="Tasks Wiki" href="http://codeconsult.ch/wiki/index.php/FopTasks"/>
<menu-item label="Design" href="../design/index.html"/>
</menu>
</book>
<code>path/file.ext</code> or <code>../file.ext</code>. The string
<code>file:path/file.ext</code> is <em>not</em> a relative URL,
in fact, it isn't a valid URL at all. A relative URL is subject to a
- <link>resolving process</link>, which transforms it into an absolute
+ resolving process, which transforms it into an absolute
URL.
</p>
<p>
- See <link>Understanding URIs and URLs</link> and <link>Understanding
- URL resolving</link>.
+ See Understanding URIs and URLs and Understanding
+ URL resolving.
</p>
</answer>
</faq>
whether you got them right.
</p>
<p>
- You can use the <link>FOP DTD</link> or <link>FOP Schema</link> to
+ You can use the FOP DTD or FOP Schema to
validate your soure. This will catch most, but still not all problems.
</p>
<p>
the user agent.
</p>
<p>
- See <link>Understanding URIs and URLs</link> and <link>Understanding
- URL resolving</link>.
+ See Understanding URIs and URLs and Understanding
+ URL resolving.
</p>
</answer>
</faq>
</li>
</ul>
<p>
- See also <link>supported image formats</link>.
+ See also supported image formats.
</p>
</answer>
</faq>
<faq>
<question>How do I use FOP in a servlet?</question>
<answer>
- <p>Look at the <link>servlet example</link>.</p>
+ <p>Look at the servlet example.</p>
<p>
A rather minimal code snippet to demonstrate the basics:
</p>
with IEx and view it later. There are other problems with this code.
</p>
<p>
- Please look into <link>Howto embed FOP in a servlet</link> for all
+ Please look into Howto embed FOP in a servlet for all
kinds of details.
</p>
</answer>
<question>How do I embed fonts in PDF?</question>
<answer>
<p>
- Provide$$$
+ See the <link href="fonts.html">Fonts</link> page for information
+ about embedding fonts.
</p>
</answer>
</faq>
<faq>
- <question>Characters not displayed, or displayed incorrectly, or displayed
- as "#"</question>
+ <question>Characters not displayed, or displayed incorrectly, or displayed as "#"</question>
<answer>
- <p> Answers are that fonts must be available on the target platform, and
+ <p>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 <link href="output.html#pdf-fonts">defined fonts</link>, other fonts can be embedded following the
+<link href="fonts.html">instructions</link>.
+To find out if the characters you need are in the core fonts then
+(todo - find a glyph font table for the fonts).
</p>
<p> For example, for most symbols, the symbol font has to be selected
- explicitely (actually: is this a feature or a bug?):
+ explicitely (in future it should be possible to specify a list of fonts
+where it will select the font for the specified character):
</p>
<p> <fo:inline font-family="Symbol">&#x2205;</fo:inline></p>
<p> 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.</p>
- <p>(Still applicable in 0.20.3?)</p>
</answer>
</faq>
<faq>
<question>How can I contribute?</question>
<answer>
<p>
- There is always plenty of things to do. See <link>limitations</link>
- and <link>bugzilla</link>.
+ There is always plenty of things to do. See
+ <link href="involved.html">getting involved</link>.
</p>
</answer>
</faq>
master definitions.
</p>
<p>
- See also <link>release notes</link>.
+ See also <link href="relnotes.html">release notes</link>.
</p>
</answer>
</faq>
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 <fork href="http://java.sun.com">download</fork>
- and <link>install</link> it by yourself.
+ and install it by yourself.
</p>
</answer>
</faq>
<faq>
<question>I get a NoClassDefFound exception.</question>
<answer>
- <p>This is typically a problem with your <link>classpath</link>.</p>
+ <p>This is typically a problem with your classpath.</p>
<p>If you are running FOP from the command line:</p>
<ul>
<li>
</p>
<ul>
<li>
- Avoid forward <link>references</link>. Forward references cause all
+ Avoid forward references. Forward references cause all
pages from the page with the reference on to be held in memory until
the page with the referenced element is encountered. Common forward
references are table of contents at the beginning of the document
- and the <link>"page N of TOTAL"</link> in footers. Forward
+ and the <link href="#pagenum">"page N of TOTAL"</link> in footers. Forward
references may be required by the task, however, if you are getting
a memory overflow you should at least check whether this is really
as necessary as claimed. A TOC, for example, could often be placed
possibly be freed after the page sequence has been rendered.
</li>
<li>
- Increase <link>memory settings of the JVM</link>. Be aware that it
+ Increase memory settings of the JVM. Be aware that it
is usually unwise to increase the memory allocated to the JVM beyond
the amount of physical RAM, it will significantly slow down. YMMV.
</li>
</p>
<p>
Reducing memory consumption in general and squishing bugs is an
- ongoing effort, partially addressed in the <link>redesign</link>.
+ ongoing effort, partially addressed in the <link href="dev/index.html">redesign</link>.
</p>
</answer>
</faq>
<faq>
<question>I get a MalformedURLException.</question>
<answer>
+ <anchor id="MalformedURL"/>
<p>
What you probably think of as "file names" are usually URLs, in
particular the src attribute of fo:external-graphic.
<code>path/file.ext</code> or <code>../file.ext</code>. The string
<code>file:path/file.ext</code> is <em>not</em> a relative URL,
in fact, it isn't a valid URL at all. A relative URL is subject to a
- <link>resolving process</link>, which transforms it into an absolute
+ resolving process, which transforms it into an absolute
URL.
</p>
<p>
- See <link>Understanding URIs and URLs</link> and <link>Understanding
- URL resolving</link>.
+ See Understanding URIs and URLs and Understanding
+ URL resolving.
</p>
</answer>
</faq>
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, <link>baseDir can be set explicitely</link>. If
+ embedded in a servlet, <link href="embedding.html">baseDir can be set explicitely</link>. If
it's not set, it is usually the current working directory of the
process which runs FOP.
</p>
<p>
- See <link>Understanding URIs and URLs</link> and <link>Understanding
- URL resolving</link>.
+ See Understanding URIs and URLs and Understanding
+ URL resolving.
</p>
</answer>
</faq>
</li>
</ul>
<p>
- See also <link>supported image formats</link>.
+ See also supported image formats.
</p>
</answer>
</faq>
<faq>
<question>How do I use FOP in a servlet?</question>
<answer>
- <p>Look at the <link>servlet example</link>.</p>
+ <p>Look at the servlet example.</p>
<p>
A rather minimal code snippet to demonstrate the basics:
</p>
with IEx and view it later. There are other problems with this code.
</p>
<p>
- Please look into <link>Howto embed FOP in a servlet</link> for all
+ Please look into Howto embed FOP in a servlet for all
kinds of details.
</p>
</answer>
<li>
Make sure that the reference is valid in the current SVG document.
</li>
- <li>
- **DOES THIS WORK**
- Let the URL refer to some location where the gradient could be
- retrieved, for example if the SVG code is embedded in your XSL,
- try <code>fill="url(my.xsl#PurpleToWhite)"</code>.
- </li>
</ul>
<p>
In any case, the referenced stuff has to be pointed to by an URL. It
but also some effort by a standard committee in order to make the
semantics of this kind of references in embedded SVG clearer.
</p>
- <p>See also <link>MalformedURLException</link></p>
+ <p>See also <link href="#MalformedURL">MalformedURLException</link></p>
</answer>
</faq>
</part>
<question>How do I embed fonts in PDF?</question>
<answer>
<p>
- Provide$$$
+ See the <link href="fonts.html">Fonts</link> page for information
+ about embedding fonts.
</p>
</answer>
</faq>
<question>Characters not displayed, or displayed incorrectly, or displayed
as "#"</question>
<answer>
- <p> Answers are that fonts must be available on the target platform, and
+ <p>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 <link href="output.html#pdf-fonts">defined fonts</link>, other fonts can be embedded following the
+<link href="fonts.html">instructions</link>.
+To find out if the characters you need are in the core fonts then
+(todo - find a glyph font table for the fonts).
</p>
<p> For example, for most symbols, the symbol font has to be selected
- explicitely (actually: is this a feature or a bug?):
+ explicitely (in future it should be possible to specify a list of fonts
+where it will select the font for the specified character):
</p>
<p> <fo:inline font-family="Symbol">&#x2205;</fo:inline></p>
<p> 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.</p>
- <p>(Still applicable in 0.20.3?)</p>
</answer>
</faq>
<faq id="PDF-postprocess">
<question>(FO) How do I print the total number of pages, like in "page 1
of 12"</question>
<answer>
+ <anchor id="pagenum"/>
<p>
(XSL FAQ)
</p>
offending characters.
</p>
<p>
- Refer to the <link>XML specification</link> or to a good tutorial for
+ Refer to the <link href="http://www.w3.org/XML/">XML specification</link> or to a good tutorial for
details of the XML file format.
</p>
</answer>
(<fo:external-graphic content-width="75pt" content-height="100pt" scaling="uniform" src="images/fop.jpg"/>)
has uniform scaling.
</fo:block>
+ <fo:block>
+The image
+(<fo:external-graphic width="75pt" height="100pt" content-width="scale-to-fit" content-height="scale-to-fit" src="images/fop.jpg"/>)
+is scaled to fit the viewport.
+ </fo:block>
</fo:block>
<fo:block>
</p>
<p>Font support in FOP can be extended by the addition of font metric files (written in XML) created from Adobe
Type 1 fonts and TrueType fonts. No other font types (Type 3, etc.) are supported at this time.
+ More information about font types can be found at
+ the <link href="http://partners.adobe.com/asn/developer/type/ftypes.html">
+ Adobe font types</link>. There is also lots more font information
+ on this <link href="http://partners.adobe.com/asn/developer/technotes/fonts.html">Adobe Font Technote</link>.
</p>
<note>
The font is simply embedded into the PDF file, it is not converted.
</p>
<p>Windows:</p>
<source>
-
- java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar;lib\xercesImpl.jar;lib\xalan.jar org.apache.fop.fonts.apps.PFMReader pfm-file xml-file
-
+java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar;
+ lib\xercesImpl.jar;lib\xalan.jar
+ org.apache.fop.fonts.apps.PFMReader pfm-file xml-file
</source>
<p>Unix:</p>
<source>
-
- java -cp build/fop.jar:lib/avalon-framework.jar:lib/xml-apis.jar:lib/xercesImpl.jar:lib/xalan.jar org.apache.fop.fonts.apps.PFMReader pfm-file xml-file
-
+java -cp build/fop.jar:lib/avalon-framework.jar:lib/xml-apis.jar:
+ lib/xercesImpl.jar:lib/xalan.jar
+ org.apache.fop.fonts.apps.PFMReader pfm-file xml-file
</source>
<note>
The classpath in the above example has been simplified for readibity.
<section>
<title>Register the fonts within FOP</title>
<p>
- Edit conf/userconfig.xml and add entries for the font
- if the fonts section,
- ie:
+ Edit conf/userconfig.xml and add entries for the font
+ if the fonts section,
+ ie:
</p>
-<source>
-<![CDATA[
- <font metrics-file="FTL_____.xml" kerning="yes" embed-file="C:\myfonts\FTL_____.pfb">
- <font-triplet name="FrutigerLight" style="normal" weight="normal">
- </font>]]>
-
-</source>
+<source><![CDATA[<font metrics-file="FTL_____.xml" kerning="yes"
+ embed-file="C:\myfonts\FTL_____.pfb">
+ <font-triplet name="FrutigerLight" style="normal" weight="normal">
+</font>]]></source>
<note>
Starting from FOP version 0.20.5 you can use URLs for the paths to the font files. Relative URLs are resolved
relative to the fontBaseDir property (or baseDir) if available.
the name cmr10.ttf and exists in c:\myfonts\):
</p>
<source>
-
- java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar;lib\xercesImpl.jar;lib\xalan.jar org.apache.fop.fonts.apps.TTFReader C:\myfonts\cmr10.ttf C:\myfonts\cmr10.ttf ttfcm.xml
-
+java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar;
+ lib\xercesImpl.jar;lib\xalan.jar
+ org.apache.fop.fonts.apps.TTFReader
+ C:\myfonts\cmr10.ttf C:\myfonts\cmr10.ttf ttfcm.xml
</source>
</section>
<section>
Example on generating metrics for a .ttc file:
</p>
<source>
-
- java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar;lib\xercesImpl.jar;lib\xalan.jar org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho" msmincho.ttc msminch.xml
-
+java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar;
+ lib\xercesImpl.jar;lib\xalan.jar
+ org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho"
+ msmincho.ttc msminch.xml
</source>
</section>
<p>
Similiar to Type 1 fonts.
</p>
-<source>
-<![CDATA[
- <font metrics-file="cyberbit.xml" kerning="yes" embed-file="C:\WINNT\Fonts\Cyberbit.ttf">
- <font-triplet name="Cyberbit" style="normal" weight="normal">
- </font>]]>
-
-</source>
+<source><![CDATA[<font metrics-file="cyberbit.xml" kerning="yes"
+ embed-file="C:\WINNT\Fonts\Cyberbit.ttf">
+ <font-triplet name="Cyberbit" style="normal" weight="normal">
+</font>]]></source>
</section>
</section>
version for Acrobat Reader (4.0), PDF versions are forwards/backwards
compatible.
</p>
+ <anchor id="pdf-fonts"/>
+ <p>
+ PDF has a set of fonts that are always available to all PDF viewers,
+ to quote from the PDF Specification:
+
+<em>"PDF prescribes a set of 14 standard fonts that can be used without prior
+definition.
+These include four faces each of three Latin text typefaces (Courier,
+Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf
+Dingbats). These fonts, or suitable substitute fonts with the same metrics, are
+guaranteed to be available in all PDF viewer applications."</em>
+ </p>
</section>
<section>
<title>PCL</title>