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.fop.svg.PDFTranscoder
All Implemented Interfaces:
org.apache.batik.transcoder.Transcoder

public class PDFTranscoder
extends org.apache.batik.transcoder.XMLAbstractTranscoder

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,v 1.11.2.1 2001/12/03 07:40:17 keiron Exp $
Author:
Keiron Liddle

Inner Class Summary
protected  class PDFTranscoder.ImageTranscoderUserAgent
          A user agent implementation for ImageTranscoder.
 
Field Summary
protected static java.util.Set FEATURES
           
static org.apache.batik.transcoder.TranscodingHints.Key KEY_STROKE_TEXT
           
protected  org.apache.batik.bridge.UserAgent userAgent
          The user agent dedicated to an ImageTranscoder.
 
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
protected  org.apache.batik.dom.util.DocumentFactory createDocumentFactory(org.w3c.dom.DOMImplementation domImpl, java.lang.String parserClassname)
          Creates a DocumentFactory that is used to create an SVG DOM tree.
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.XMLAbstractTranscoder
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
 

Field Detail

KEY_STROKE_TEXT

public static final org.apache.batik.transcoder.TranscodingHints.Key KEY_STROKE_TEXT

userAgent

protected org.apache.batik.bridge.UserAgent userAgent
The user agent dedicated to an ImageTranscoder.

FEATURES

protected static final java.util.Set FEATURES
Constructor Detail

PDFTranscoder

public PDFTranscoder()
Constructs a new ImageTranscoder.
Method Detail

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.
Overrides:
transcode in class org.apache.batik.transcoder.XMLAbstractTranscoder
Parameters:
document - the document to transcode
uri - the uri of the document or null if any
output - the ouput where to transcode
Throws:
org.apache.batik.transcoder.TranscoderException - if an error occured while transcoding

createDocumentFactory

protected org.apache.batik.dom.util.DocumentFactory createDocumentFactory(org.w3c.dom.DOMImplementation domImpl,
                                                                          java.lang.String parserClassname)
Creates a DocumentFactory that is used to create an SVG DOM tree. The specified DOM Implementation is ignored and the Batik SVG DOM Implementation is automatically used.
Overrides:
createDocumentFactory in class org.apache.batik.transcoder.XMLAbstractTranscoder
Parameters:
domImpl - the DOM Implementation (not used)
parserClassname - the XML parser classname


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.