<?xml version="1.0" encoding="ISO-8859-1"?><!--
  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: svg.xml 1298724 2012-03-09 07:55:31Z cbowditch $ --><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "http://forrest.apache.org/dtd/document-v13.dtd">
<document>
  <header>
    <title>Apache&#8482; FOP Development: SVG Issues</title>
    <version>$Revision: 1298724 $</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 colspan="1" rowspan="1"/>
      <th colspan="1" rowspan="1">svg file</th>
      <th colspan="1" rowspan="1">png file</th>
      <th colspan="1" rowspan="1">pdf result</th>
    </tr>
    <tr>
      <td colspan="1" rowspan="1">images</td>
      <td colspan="1" rowspan="1"><link href="svg/images.svg">images.svg</link></td>
      <td colspan="1" rowspan="1"><link href="svg/images.png">images.png</link></td>
      <td colspan="1" rowspan="1"><link href="svg/images.pdf">images.pdf</link></td>
    </tr>
    <tr>
      <td colspan="1" rowspan="1">svg linking</td>
      <td colspan="1" rowspan="1"><link href="svg/link.svg">link.svg</link></td>
      <td colspan="1" rowspan="1"><link href="svg/link.png">link.png</link></td>
      <td colspan="1" rowspan="1"><link href="svg/link.pdf">link.pdf</link></td>
    </tr>
    <tr>
      <td colspan="1" rowspan="1">gradients and patterns</td>
      <td colspan="1" rowspan="1"><link href="svg/paints.svg">paints.svg</link></td>
      <td colspan="1" rowspan="1"><link href="svg/paints.png">paints.png</link></td>
      <td colspan="1" rowspan="1"><link href="svg/paints.pdf">paints.pdf</link></td>
    </tr>
    <tr>
      <td colspan="1" rowspan="1">various text and effects on text</td>
      <td colspan="1" rowspan="1"><link href="svg/text.svg">text.svg</link></td>
      <td colspan="1" rowspan="1"><link href="svg/text.png">text.png</link></td>
      <td colspan="1" rowspan="1"><link href="svg/text.pdf">text.pdf</link></td>
    </tr>
    <tr>
      <td colspan="1" rowspan="1">transparent objects</td>
      <td colspan="1" rowspan="1"><link href="svg/transparency.svg">transparency.svg</link></td>
      <td colspan="1" rowspan="1"><link href="svg/transparency.png">transparency.png</link></td>
      <td colspan="1" rowspan="1"><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 colspan="1" rowspan="1"/>
      <th colspan="1" rowspan="1">fo file</th>
      <th colspan="1" rowspan="1">pdf result</th>
    </tr>
    <tr>
      <td colspan="1" rowspan="1">embedding svg</td>
      <td colspan="1" rowspan="1"><link href="fo/embedding.fo">embedding.fo</link></td>
      <td colspan="1" rowspan="1"><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>