home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Copyright 1999-2004 The Apache Software Foundation
-
- Licensed 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.
- -->
- <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "document-v10.dtd">
-
- <document>
- <header>
- <title>SVG/JPEG Serializer</title>
- <version>0.9</version>
- <type>Technical document</type>
- <authors>
- <person name="Carsten Ziegeler" email="cziegeler@apache.org"/>
- <person name="Bernhard Huber" email="huber@apache.org"/>
- </authors>
- <abstract>This document describes the svg/jpeg serializer of Cocoon.</abstract>
- </header>
- <body>
- <s1 title="SVG/JPEG Serializer">
- <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>
- <s2 title="Sitemap Configuration">
- <p>
- A minimal sitemap configuration snippet declaring the svg2jpeg serializer:
- </p>
- <source><![CDATA[
- <map:serializers..
- <map:serializer name="svg2jpeg"
- src="org.apache.cocoon.serialization.SVGSerializer"
- mime-type="image/jpeg"
- logger="sitemap.serializer.svg2jpeg"
- >
- </map:serializer>
- ]]></source>
- <p>
- A sitemap pipeline snippet using the svg2jpeg serializer:
- </p>
- <source><![CDATA[
- <map:match pattern="svg/*.jpg">
- <map:generate src="docs/samples/svg/{1}.svg"/>
- <map:serialize type="svg2jpeg"/>
- </map:match>
- ]]></source>
- <p>
- In the declaration section of the svg2jpeg a number of parameters can be specified.
- The following snippet set the background color explicitly:
- </p>
- <source><![CDATA[
- <map:serializers..
- <map:serializer name="svg2jpeg"
- src="org.apache.cocoon.serialization.SVGSerializer"
- mime-type="image/jpeg"
- logger="sitemap.serializer.svg2jpeg"
- >
- <parameter name="background_color" type="color" value="#ff00ff"/>
- </map:serializer>
- ]]></source>
- </s2>
- <s2 title="JPEGTranscoder Parameters">
- <p>
- General ImageTranscoder parameters are described
- at the <link href="svg-serializer.html">SVG Serializer</link> user documentation.
- </p>
- <p>
- The following section presents JPEGTranscoder specific parameters configurable for the JPEGTranscoder.
- </p>
- <table>
- <tr><th>Parameter</th><th>Type</th><th>Comment</th></tr>
- <tr><td>quality</td><td>float</td><td>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>
- </s2>
- <s2 title="Further Reading">
- <p>
- Further details about JPEGTranscoder, ImageTranscoder is available
- at <link href="http://xml.apache.org/batik">Batik</link>.
- </p>
- </s2>
- </s1>
- </body>
- </document>
-
-