Run SVG embedding.fo Example in fop-2.0-bin.zip

Q

How to run the SVG "embedding.fo" example in fop-2.0-bin.zip to generated a PDF file?

✍: FYIcenter.com

A

fop-2.0-bin.zip comes with an example XSL-FO file, embedding.fo, which shows how to embed SVG images into PDF files. You can use the "fop" command to convert it into a PDF file:

\fyicenter>cd \local\fop-2.0

\local\fop-2.0>echo %java_home%
   \Program Files\Java\jdk1.8.0_45\

\local\fop-2.0>fop examples\fo\svg\embedding.fo \temp\embedding.pdf
... org.apache.fop.events.LoggingEventListener processEvent
WARNING: Font "Symbol,normal,700" not found. Substituting with 
"Symbol,normal,400".
... org.apache.fop.events.LoggingEventListener processEvent
WARNING: Font "ZapfDingbats,normal,700" not found. Substituting 
with "ZapfDingbats,normal,400".
... org.apache.fop.events.LoggingEventListener processEvent
WARNING: The contents of fo:instream-foreign-object line 1 exceed 
the available area in the inline-progression direction by 31763 
millipoints. (See position 36:29)
... org.apache.fop.events.LoggingEventListener processEvent
INFO: Rendered page #1.
... org.apache.fop.events.LoggingEventListener processEvent
INFO: Rendered page #2.

The output PDF file is located at \temp\embedding.pdf. Open it with a PDF viewer, you will see something like this:

Back to FAQ on FOP (Formatting Objects Processor).

2016-07-03, 1071👍, 0💬