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.
KEY_AUTO_FONTS to disable the auto-detection of fonts installed in the system.
The PDF Transcoder cannot use AWT's font subsystem and that's why the fonts have to be
configured differently. By default, font auto-detection is enabled to match the behaviour
of the other transcoders, but this may be associated with a price in the form of a small
performance penalty. If font auto-detection is not desired, it can be disable using this key.
configure
public void configure(Configuration cfg)
throws ConfigurationException
createBridgeContext
protected BridgeContext createBridgeContext()
createBridgeContext
public BridgeContext createBridgeContext(String version)
transcode
protected void transcode(Document document,
String uri,
TranscoderOutput output)
throws TranscoderException
Transcodes the specified Document as an image in the specified output.
document
- the document to transcodeuri
- the uri of the document or null if anyoutput
- the ouput where to transcode