Class AbstractPSTranscoder
- 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.render.ps.AbstractPSTranscoder
-
- All Implemented Interfaces:
org.apache.batik.transcoder.Transcoder,Configurable
- Direct Known Subclasses:
EPSTranscoder,PSTranscoder
public abstract class AbstractPSTranscoder extends AbstractFOPTranscoder
This class enables to transcode an input to a PostScript document.
Two transcoding hints (
KEY_WIDTHandKEY_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_COLORdefines 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_AOIrepresents the area of interest to paint in device space.Three additional transcoding hints that act on the SVG processor can be specified:
KEY_LANGUAGEto set the default language to use (may be used by a <switch> SVG element for example),KEY_USER_STYLESHEET_URIto fix the URI of a user stylesheet, andKEY_PIXEL_TO_MMto specify the pixel to millimeter conversion factor.This work was authored by Keiron Liddle (keiron@aftexsw.com).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.fop.svg.AbstractFOPTranscoder
AbstractFOPTranscoder.FOPErrorHandler, AbstractFOPTranscoder.FOPTranscoderUserAgent
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2Dgraphicsthe root Graphics2D instance for generating PostScript-
Fields inherited from class org.apache.fop.svg.AbstractFOPTranscoder
KEY_AUTO_FONTS, KEY_DEVICE_RESOLUTION, KEY_STROKE_TEXT, VALUE_FORMAT_OFF, VALUE_FORMAT_ON
-
Fields inherited from class org.apache.batik.transcoder.SVGAbstractTranscoder
builder, ctx, curAOI, curTxf, DEFAULT_ALLOWED_SCRIPT_TYPES, DEFAULT_DEFAULT_FONT_FAMILY, height, KEY_ALLOW_EXTERNAL_RESOURCES, 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_SNAPSHOT_TIME, KEY_USER_STYLESHEET_URI, KEY_WIDTH, root, userAgent, width
-
-
Constructor Summary
Constructors Constructor Description AbstractPSTranscoder()Constructs a newAbstractPSTranscoder.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected org.apache.batik.bridge.BridgeContextcreateBridgeContext()org.apache.batik.bridge.BridgeContextcreateBridgeContext(java.lang.String version)protected abstract org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2DcreateDocumentGraphics2D()Creates the root Graphics2D instance for generating PostScript.protected booleangetAutoFontsDefault()Returns the default value for the KEY_AUTO_FONTS value.protected voidtranscode(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.fop.svg.AbstractFOPTranscoder
configure, createDocumentFactory, createUserAgent, getDeviceResolution, getEffectiveConfiguration, getImageManager, getImageSessionContext, getLogger, isTextStroked, setEntityResolver, setLogger, setupImageInfrastructure
-
Methods inherited from class org.apache.batik.transcoder.SVGAbstractTranscoder
createBridgeContext, getCanvasGraphicsNode, setImageSize, transcode
-
Methods inherited from class org.apache.batik.transcoder.TranscoderSupport
addTranscodingHint, getErrorHandler, getTranscodingHints, removeTranscodingHint, setErrorHandler, setTranscodingHints, setTranscodingHints
-
-
-
-
Constructor Detail
-
AbstractPSTranscoder
public AbstractPSTranscoder()
Constructs a newAbstractPSTranscoder.
-
-
Method Detail
-
createDocumentGraphics2D
protected abstract org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D createDocumentGraphics2D()
Creates the root Graphics2D instance for generating PostScript.- Returns:
- the root Graphics2D
-
getAutoFontsDefault
protected boolean getAutoFontsDefault()
Returns the default value for the KEY_AUTO_FONTS value.- Overrides:
getAutoFontsDefaultin classAbstractFOPTranscoder- Returns:
- the default value
-
transcode
protected void transcode(org.w3c.dom.Document document, java.lang.String uri, org.apache.batik.transcoder.TranscoderOutput output) throws org.apache.batik.transcoder.TranscoderExceptionTranscodes the specified Document as an image in the specified output.- Overrides:
transcodein classorg.apache.batik.transcoder.SVGAbstractTranscoder- 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()
- Overrides:
createBridgeContextin classorg.apache.batik.transcoder.SVGAbstractTranscoder
-
createBridgeContext
public org.apache.batik.bridge.BridgeContext createBridgeContext(java.lang.String version)
- Overrides:
createBridgeContextin classorg.apache.batik.transcoder.SVGAbstractTranscoder
-
-