Hope to see you there!
Hope to see you there!
See alsoSVG User Documentation for more information.
These examples illustrate a number of issues relating to conversion to PDF:
| svg file | png file | pdf result | |
|---|---|---|---|
| images | images.svg | images.png | images.pdf |
| svg linking | link.svg | link.png | link.pdf |
| gradients and patterns | paints.svg | paints.png | paints.pdf |
| various text and effects on text | text.svg | text.png | text.pdf |
| transparent objects | transparency.svg | transparency.png | transparency.pdf |
As can be seen most of the specific issues are handled.
| fo file | pdf result | |
|---|---|---|
| embedding svg | embedding.fo | embedding.fo.pdf |
For most output formats in FOP the SVG is simply drawn into an image with Batik. For PDF there are a set of classes to handle drawing theGVT (Graphic Vector Toolkit) into PDF markup.
These are the relevant classes, found in the package org.apache.fop.svg:
PDFGraphics2D
used for drawing onto a Graphics2D into an existing pdf document, used internally to draw the svg.
PDFDocumentGraphics2D
used to create a pdf document and inherits from PDFGraphics2D to do the rest of the drawing. Used by the transcoder to create a standalone pdf document from an svg. Can be used independantly the same as any Graphics2D.
PDFTranscoder
used by Batik to transcode an svg document into a standalone pdf, via PDFDocumentGraphics2D.
Batik can convert ttf to svg font. This svg font could be converted into a pdf stroked font (type 3 font).
Copyright © 2025 The Apache Software Foundation, Licensed undertheApache License, Version 2.0.
Apache, Apache XML Graphics, Apache FOP, Apache Batik, the Apache logo, and theApache XML Graphics logos are trademarks ofThe ApacheSoftware Foundation. All other marks mentioned may be trademarks or registeredtrademarks of their respective owners.