blob: 1af49d90c54c3d32e9c04fac355ead9fdf75afa1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN"
"http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-forrest/src/resources/schema/dtd/document-v11.dtd">
<document>
<header>
<title>SVG Developer Issues</title>
</header>
<body>
<p>See also <link href="../svg.html">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>
<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>
<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>
|