blob: 54955e024231195e3f13f763d9831c8020755a46 [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/JPEG 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/jpeg serializer of Cocoon." name="DC.Description">
</head>
<body>
<h1>SVG/JPEG Serializer</h1>
<p>
The SVG/JPEG serializes an xml svg document to a jpeg image.
The serialization uses the Batik's JPEGTranscoder internally.
</p>
<ul>
<li>Name : svg2jpeg</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 svg2jpeg serializer:
</p>
<pre class="code">
&lt;map:serializers..
&lt;map:serializer name="svg2jpeg"
src="org.apache.cocoon.serialization.SVGSerializer"
mime-type="image/jpeg"
logger="sitemap.serializer.svg2jpeg"
&gt;
&lt;/map:serializer&gt;
</pre>
<p>
A sitemap pipeline snippet using the svg2jpeg serializer:
</p>
<pre class="code">
&lt;map:match pattern="svg/*.jpg"&gt;
&lt;map:generate src="docs/samples/svg/{1}.svg"/&gt;
&lt;map:serialize type="svg2jpeg"/&gt;
&lt;/map:match&gt;
</pre>
<p>
In the declaration section of the svg2jpeg 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="svg2jpeg"
src="org.apache.cocoon.serialization.SVGSerializer"
mime-type="image/jpeg"
logger="sitemap.serializer.svg2jpeg"
&gt;
&lt;parameter name="background_color" type="color" value="#ff00ff"/&gt;
&lt;/map:serializer&gt;
</pre>
<h2>JPEGTranscoder 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 JPEGTranscoder specific parameters configurable for the JPEGTranscoder.
</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">quality</td><td colspan="1" rowspan="1">float</td><td colspan="1" rowspan="1">Specifies the JPEG quality as value between 0.0 and 1.0,
1.0 specifies highest quality. Usually a value of 0.9 is choosen.</td>
</tr>
</table>
<h2>Further Reading</h2>
<p>
Further details about JPEGTranscoder, ImageTranscoder is available
at <a class="external" href="http://xml.apache.org/batik">Batik</a>.
</p>
</body>
</html>