SVG/JPEG Serializer
http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Main
User Documentation

Serializers
Overview

Default
HTML Serializer

Core
XHTML Serializer
XML Serializer
Text Serializer
WAP/WML Serializer
SVG Serializer
SVG/XML Serializer
SVG/JPEG Serializer
SVG/PNG Serializer
SVG/TIFF Serializer
VRML Serializer
Link Serializer
Zip archive Serializer

Optional
PDF Serializer
PS Serializer
PCL Serializer
HSSF (XLS) Serializer

SVG/JPEG Serializer

The SVG/JPEG serializes an xml svg document to a jpeg image. The serialization uses the Batik's JPEGTranscoder internally.

  • Name : svg2jpeg
  • Class: org.apache.cocoon.serialization.SVGSerializer
  • Cacheable: yes
Sitemap Configuration

A minimal sitemap configuration snippet declaring the svg2jpeg serializer:

<map:serializers..
  <map:serializer name="svg2jpeg"
    src="org.apache.cocoon.serialization.SVGSerializer"
    mime-type="image/jpeg"
    logger="sitemap.serializer.svg2jpeg"
  >
  </map:serializer>

A sitemap pipeline snippet using the svg2jpeg serializer:

<map:match pattern="svg/*.jpg">
  <map:generate src="docs/samples/svg/{1}.svg"/>
  <map:serialize type="svg2jpeg"/>
</map:match>

In the declaration section of the svg2jpeg a number of parameters can be specified. The following snippet set the background color explicitly:

<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>
JPEGTranscoder Parameters

General ImageTranscoder parameters are described at the SVG Serializer user documentation.

The following section presents JPEGTranscoder specific parameters configurable for the JPEGTranscoder.

ParameterTypeComment
qualityfloatSpecifies the JPEG quality as value between 0.0 and 1.0, 1.0 specifies highest quality. Usually a value of 0.9 is choosen.
Further Reading

Further details about JPEGTranscoder, ImageTranscoder is available at Batik.

Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.