org.apache.fop.svg
Class PDFTranscoder
java.lang.Object
org.apache.batik.transcoder.TranscoderSupport
org.apache.batik.transcoder.AbstractTranscoder
org.apache.batik.transcoder.XMLAbstractTranscoder
org.apache.batik.transcoder.SVGAbstractTranscoder
org.apache.fop.svg.AbstractFOPTranscoder
org.apache.fop.svg.PDFTranscoder
- All Implemented Interfaces:
- org.apache.avalon.framework.configuration.Configurable, org.apache.batik.transcoder.Transcoder
- public class PDFTranscoder
- extends AbstractFOPTranscoder
- implements org.apache.avalon.framework.configuration.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 426576 2006-07-28 15:44:37Z jeremias $
- Author:
- Keiron Liddle
Nested classes inherited from class org.apache.batik.transcoder.SVGAbstractTranscoder |
org.apache.batik.transcoder.SVGAbstractTranscoder.SVGAbstractTranscoderUserAgent |
Field Summary |
protected PDFDocumentGraphics2D |
graphics
Graphics2D instance that is used to paint to |
static org.apache.batik.transcoder.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. |
Fields inherited from class org.apache.batik.transcoder.SVGAbstractTranscoder |
builder, ctx, curAOI, curTxf, DEFAULT_ALLOWED_SCRIPT_TYPES, DEFAULT_DEFAULT_FONT_FAMILY, height, KEY_ALLOWED_SCRIPT_TYPES, KEY_ALTERNATE_STYLESHEET, KEY_AOI, KEY_CONSTRAIN_SCRIPT_ORIGIN, KEY_DEFAULT_FONT_FAMILY, KEY_EXECUTE_ONLOAD, KEY_HEIGHT, KEY_LANGUAGE, KEY_MAX_HEIGHT, KEY_MAX_WIDTH, KEY_MEDIA, KEY_PIXEL_TO_MM, KEY_PIXEL_UNIT_TO_MILLIMETER, KEY_USER_STYLESHEET_URI, KEY_WIDTH, root, width |
Fields inherited from class org.apache.batik.transcoder.XMLAbstractTranscoder |
KEY_DOCUMENT_ELEMENT, KEY_DOCUMENT_ELEMENT_NAMESPACE_URI, KEY_DOM_IMPLEMENTATION, KEY_XML_PARSER_CLASSNAME, KEY_XML_PARSER_VALIDATING |
Fields inherited from class org.apache.batik.transcoder.TranscoderSupport |
handler, hints |
Constructor Summary |
PDFTranscoder()
Constructs a new ImageTranscoder. |
Method Summary |
void |
configure(org.apache.avalon.framework.configuration.Configuration cfg)
|
protected org.apache.batik.bridge.BridgeContext |
createBridgeContext()
|
protected org.apache.batik.bridge.UserAgent |
createUserAgent()
Creates and returns the default user agent for this transcoder. |
protected void |
transcode(org.w3c.dom.Document document,
java.lang.String uri,
org.apache.batik.transcoder.TranscoderOutput output)
Transcodes the specified Document as an image in the specified output. |
Methods inherited from class org.apache.batik.transcoder.SVGAbstractTranscoder |
getCanvasGraphicsNode, setImageSize, transcode |
Methods inherited from class org.apache.batik.transcoder.TranscoderSupport |
addTranscodingHint, getErrorHandler, getTranscodingHints, removeTranscodingHint, setErrorHandler, setTranscodingHints, setTranscodingHints |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.batik.transcoder.Transcoder |
addTranscodingHint, getErrorHandler, getTranscodingHints, removeTranscodingHint, setErrorHandler, setTranscodingHints, setTranscodingHints |
KEY_DEVICE_RESOLUTION
public static final org.apache.batik.transcoder.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
PDFTranscoder
public PDFTranscoder()
- Constructs a new ImageTranscoder.
createUserAgent
protected org.apache.batik.bridge.UserAgent createUserAgent()
- Description copied from class:
AbstractFOPTranscoder
- Creates and returns the default user agent for this transcoder. Override
this method if you need non-default behaviour.
- Overrides:
createUserAgent
in class AbstractFOPTranscoder
- Returns:
- UserAgent the newly created user agent
- See Also:
AbstractFOPTranscoder.createUserAgent()
configure
public void configure(org.apache.avalon.framework.configuration.Configuration cfg)
throws org.apache.avalon.framework.configuration.ConfigurationException
- Specified by:
configure
in interface org.apache.avalon.framework.configuration.Configurable
- Throws:
org.apache.avalon.framework.configuration.ConfigurationException
- See Also:
Configurable.configure(Configuration)
transcode
protected void transcode(org.w3c.dom.Document document,
java.lang.String uri,
org.apache.batik.transcoder.TranscoderOutput output)
throws org.apache.batik.transcoder.TranscoderException
- Transcodes the specified Document as an image in the specified output.
- Parameters:
document
- the document to transcodeuri
- the uri of the document or null if anyoutput
- the ouput where to transcode
- Throws:
org.apache.batik.transcoder.TranscoderException
- if an error occured while transcoding
createBridgeContext
protected org.apache.batik.bridge.BridgeContext createBridgeContext()
- See Also:
SVGAbstractTranscoder.createBridgeContext()
Copyright 1999-2006 The Apache Software Foundation. All Rights Reserved.