blob: 325826aa7881d75a2ed22bffcdefdde4283f09eb [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SVG/TIFF Serializer</title>
<link href="http://purl.org/DC/elements/1.0/" rel="schema.DC">
<meta content="Carsten Ziegeler" name="DC.Creator">
<meta content="Bernhard Huber" name="DC.Creator">
<meta content="This document describes the svg/tiff serializer of Cocoon." name="DC.Description">
</head>
<body>
<h1>SVG/TIFF Serializer</h1>
<p>
The SVG/TIFF serializes an xml svg document to a tiff image.
The serialization uses the Batik's TIFFTranscoder internally.
</p>
<ul>
<li>Name : svg2tiff</li>
<li>Class: org.apache.cocoon.serialization.SVGSerializer</li>
<li>Cacheable: yes</li>
</ul>
<h2>Sitemap Configuration</h2>
<p>
A minimal sitemap configuration snippet declaring the svg2tiff serializer:
</p>
<pre class="code">
&lt;map:serializers..
&lt;map:serializer name="svg2tiff"
src="org.apache.cocoon.serialization.SVGSerializer"
mime-type="image/tiff"
logger="sitemap.serializer.svg2tiff"
&gt;
&lt;/map:serializer&gt;
</pre>
<p>
A sitemap pipeline snippet using the svg2tiff serializer:
</p>
<pre class="code">
&lt;map:match pattern="svg/*.tiff"&gt;
&lt;map:generate src="docs/samples/svg/{1}.svg"/&gt;
&lt;map:serialize type="svg2tiff"/&gt;
&lt;/map:match&gt;
</pre>
<p>
In the declaration section of the svg2tiff a number of parameters can be specified.
The following snippet set the background color explicitly:
</p>
<pre class="code">
&lt;map:serializers..
&lt;map:serializer name="svg2tiff"
src="org.apache.cocoon.serialization.SVGSerializer"
mime-type="image/tiff"
logger="sitemap.serializer.svg2tiff"
&gt;
&lt;parameter name="background_color" type="color" value="#ff00ff"/&gt;
&lt;/map:serializer&gt;
</pre>
<h2>TIFFTranscoder Parameters</h2>
<p>
General ImageTranscoder parameters are described
at the <a href="svg-serializer.html">SVG Serializer</a> user documentation.
</p>
<p>
The following section presents TIFFTranscoder specific parameters configurable
for the TIFFTranscoder.
</p>
<table>
<tr>
<th colspan="1" rowspan="1">Parameter</th><th colspan="1" rowspan="1">Type</th><th colspan="1" rowspan="1">Comment</th>
</tr>
<tr>
<td colspan="1" rowspan="1">force_transparent_white</td><td colspan="1" rowspan="1">boolean</td><td colspan="1" rowspan="1">It controls whether the encoder should
force the image's fully transparent pixels to be fully transparent
white instead of fully transparent black. This is usefull when the
encoded TIFF is displayed in a viewer which does not support TIFF
transparency and lets the image display with a white background instead
of a black background.
However, note that the modified image will display differently
over a white background in a viewer that supports
transparency.</td>
</tr>
</table>
<h2>Further Reading</h2>
<p>
Further details about TIFFTranscoder, ImageTranscoder is available
at <a class="external" href="http://xml.apache.org/batik">Batik</a>.
</p>
</body>
</html>