SVGSerializerKeys

  • TARGET-AUDIENCE: *beginner*
  • COCOON-RELEASES: Current CVS
  • DOCUMENT-STATUS: *draft*

What you will get from this page

This is an exhaustive list of keys and how to use them with the SVGSerializer.

Your basic skills

  • You can edit Cocoon's sitemap file

How to use these keys

You can see a basic usage of the key in Cocoon's sitemap file:

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

  <parameter name="quality" type="float" value="0.5"/>
</map:serializer>

Key List

The following keys are available in either usage of the SVGSerializer (jpeg or png) They were taken from the Batik Javadocs. Note that since some of them deal with the contents of the SVG file and not the final image, not all keys may actually be useful.

Key Name

Type

Description

Default

WIDTH

Float

The desired width of the image

Width of the topmost SVG element

HEIGHT

Float

The desired height of the image

Height of the topmost SVG element

MAX_WIDTH

Float

Max width of the image

Width of the topmost SVG element

MAX_HEIGHT

Float

Max height of the image

Height of the topmost SVG element

LANGUAGE

String

Specify the preferred language of the image

en

MEDIA

String

Default media to use with CSS

screen

DEFAULT_FONT_FAMILY

String

Controls the default value used by the CSS engine for the font-family property when that property is unspecified.Specify the media to use with CSS.

"Arial, Helvetica, sans-serif"

ALTERNATE_STYLESHEET

String

Specifies the alternate stylesheet title

null

ALTERNATE_STYLESHEET_URI

String

URI to the stylesheet

null

BACKGROUND_COLOR

Color

A color (in HTML form, e.g. #336699) which specifies the background color of the image.

null

FORCE_TRANSPARENT_WHITE

Boolean

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 file is displayed in a browser which does not support transparency correctly 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.

false


The following keys are only available when using svg2jpeg:

Key Name

Type

Description

Default

QUALITY

Float

Compression level from 0.0 to 1.0, with 1.0 being the least compression (best quality)

1.0


The following keys are only available when using svg2png:

Key Name

Type

Description

Default

GAMMA

Float

Controls the gamma correction of the png image. A value of zero for gamma disables the generation of a gamma chunk. No value causes an sRGB chunk to be generated.

Approx 2.22

INDEXED

Integer

Turns on the reduction of the image to index colors by specifying color bit depth, 1,2,4,8. The resultant PNG will be an indexed PNG with color bit depth specified.

None (24-bpp image)

Links to other information sources


page metadata

  • REVIEWED-BY:BR
  • REVIEWER-CONTACT:BR
  • No labels