blob: b76626c5e9d9fb07ccd72f2dfee30ef83251f81c [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "http://forrest.apache.org/dtd/document-v13.dtd">
<document>
<header>
<title>Apacheā„¢ FOP Development: SVG Issues</title>
<version>$Revision$</version>
</header>
<body>
<p>See also <link href="../trunk/graphics.html#svg">SVG User Documentation</link> for more information.</p>
<section>
<title>Examples</title>
<p>
These examples illustrate a number of issues relating to conversion
to PDF:
</p>
<table>
<caption>SVG to PDF examples</caption>
<tr>
<th/>
<th>svg file</th>
<th>png file</th>
<th>pdf result</th>
</tr>
<tr>
<td>images</td>
<td><link href="svg/images.svg">images.svg</link></td>
<td><link href="svg/images.png">images.png</link></td>
<td><link href="svg/images.pdf">images.pdf</link></td>
</tr>
<tr>
<td>svg linking</td>
<td><link href="svg/link.svg">link.svg</link></td>
<td><link href="svg/link.png">link.png</link></td>
<td><link href="svg/link.pdf">link.pdf</link></td>
</tr>
<tr>
<td>gradients and patterns</td>
<td><link href="svg/paints.svg">paints.svg</link></td>
<td><link href="svg/paints.png">paints.png</link></td>
<td><link href="svg/paints.pdf">paints.pdf</link></td>
</tr>
<tr>
<td>various text and effects on text</td>
<td><link href="svg/text.svg">text.svg</link></td>
<td><link href="svg/text.png">text.png</link></td>
<td><link href="svg/text.pdf">text.pdf</link></td>
</tr>
<tr>
<td>transparent objects</td>
<td><link href="svg/transparency.svg">transparency.svg</link></td>
<td><link href="svg/transparency.png">transparency.png</link></td>
<td><link href="svg/transparency.pdf">transparency.pdf</link></td>
</tr>
</table>
<p>
As can be seen most of the specific issues are handled.
</p>
<note>
You will need Acrobat 5.0 to see transparency.
</note>
<table>
<caption>XSL:FO to PDF examples</caption>
<tr>
<th/>
<th>fo file</th>
<th>pdf result</th>
</tr>
<tr>
<td>embedding svg</td>
<td><link href="fo/embedding.fo">embedding.fo</link></td>
<td><link href="fo/embedding.fo.pdf">embedding.fo.pdf</link></td>
</tr>
</table>
</section>
<section>
<title>Developer Notes</title>
<p>
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 the
<link href="http://xml.apache.org/batik/architecture.html">GVT (Graphic Vector Toolkit)</link>
into PDF markup.
</p>
<section>
<title>Classes</title>
<p>
These are the relevant classes, found in the package org.apache.fop.svg :
</p>
<ul>
<li><em>PDFGraphics2D</em>
<br/>
used for drawing onto a Graphics2D into an existing pdf document, used
internally to draw the svg.
</li>
<li><em>PDFDocumentGraphics2D</em>
<br/>
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.
</li>
<li><em>PDFTranscoder</em>
<br/>
used by Batik to transcode an svg document into a standalone pdf, via
PDFDocumentGraphics2D.
</li>
</ul>
</section>
<section>
<title>Ideas</title>
<p>
Batik can convert ttf to svg font.
This svg font could be converted into a pdf stroked font
(type 3 font).
</p>
</section>
</section>
</body>
</document>