org.apache.fop.svg

Class PDFTranscoder

Implemented Interfaces:
Configurable

public class PDFTranscoder
extends AbstractFOPTranscoder
implements Configurable

This class enables to transcode an input to a pdf document.

Two transcoding hints (KEY_WIDTH and KEY_HEIGHT) can be used to respectively specify the image width and the image height. If only one of these keys is specified, the transcoder preserves the aspect ratio of the original image.

The KEY_BACKGROUND_COLOR defines the background color to use for opaque image formats, or the background color that may be used for image formats that support alpha channel.

The KEY_AOI represents the area of interest to paint in device space.

Three additional transcoding hints that act on the SVG processor can be specified:

KEY_LANGUAGE to set the default language to use (may be used by a <switch> SVG element for example), KEY_USER_STYLESHEET_URI to fix the URI of a user stylesheet, and KEY_PIXEL_TO_MM to specify the pixel to millimeter conversion factor.

Version:
$Id: PDFTranscoder.java 542237 2007-05-28 14:31:24Z jeremias $
Author:
Keiron Liddle

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.fop.svg.AbstractFOPTranscoder

AbstractFOPTranscoder.FOPErrorHandler, AbstractFOPTranscoder.FOPTranscoderUserAgent

Field Summary

static TranscodingHints.Key
KEY_DEVICE_RESOLUTION
The key is used to specify the resolution for on-the-fly images generated due to complex effects like gradients and filters.
protected PDFDocumentGraphics2D
graphics
Graphics2D instance that is used to paint to

Fields inherited from class org.apache.fop.svg.AbstractFOPTranscoder

KEY_STROKE_TEXT, VALUE_FORMAT_OFF, VALUE_FORMAT_ON, userAgent

Constructor Summary

PDFTranscoder()
Constructs a new ImageTranscoder.

Method Summary

void
configure(Configuration cfg)
protected BridgeContext
createBridgeContext()
protected UserAgent
createUserAgent()
protected void
transcode(Document document, String uri, TranscoderOutput output)
Transcodes the specified Document as an image in the specified output.

Methods inherited from class org.apache.fop.svg.AbstractFOPTranscoder

createDocumentFactory, createUserAgent, getLogger, setEntityResolver, setLogger

Field Details

KEY_DEVICE_RESOLUTION

public static final TranscodingHints.Key KEY_DEVICE_RESOLUTION
The key is used to specify the resolution for on-the-fly images generated due to complex effects like gradients and filters.

graphics

protected PDFDocumentGraphics2D graphics
Graphics2D instance that is used to paint to

Constructor Details

PDFTranscoder

public PDFTranscoder()
Constructs a new ImageTranscoder.

Method Details

configure

public void configure(Configuration cfg)
            throws ConfigurationException
See Also:
org.apache.avalon.framework.configuration.Configurable.configure(Configuration)

createBridgeContext

protected BridgeContext createBridgeContext()
See Also:
org.apache.batik.transcoder.SVGAbstractTranscoder.createBridgeContext()

createUserAgent

protected UserAgent createUserAgent()
Overrides:
createUserAgent in interface AbstractFOPTranscoder

transcode

protected void transcode(Document document,
                         String uri,
                         TranscoderOutput output)
            throws TranscoderException
Transcodes the specified Document as an image in the specified output.
Parameters:
document - the document to transcode
uri - the uri of the document or null if any
output - the ouput where to transcode

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.