org.apache.fop.svg

Class AbstractFOPTranscoder

Known Direct Subclasses:
AbstractPSTranscoder, PDFTranscoder

public abstract class AbstractFOPTranscoder
extends SVGAbstractTranscoder

This is the common base class of all of FOP's transcoders.

Nested Class Summary

protected class
AbstractFOPTranscoder.FOPErrorHandler
This is the default transcoder error handler for FOP.
protected class
AbstractFOPTranscoder.FOPTranscoderUserAgent
A user agent implementation for FOP's Transcoders.

Field Summary

static TranscodingHints.Key
KEY_STROKE_TEXT
The key to specify whether to stroke text instead of using text operations.
static Boolean
VALUE_FORMAT_OFF
The value to turn off text stroking.
static Boolean
VALUE_FORMAT_ON
The value to turn on text stroking.
protected UserAgent
userAgent
The user agent dedicated to this Transcoder.

Constructor Summary

AbstractFOPTranscoder()
Constructs a new FOP-style transcoder.

Method Summary

protected DocumentFactory
createDocumentFactory(DOMImplementation domImpl, String parserClassname)
Creates a DocumentFactory that is used to create an SVG DOM tree.
protected UserAgent
createUserAgent()
Creates and returns the default user agent for this transcoder.
protected Log
getLogger()
Returns the logger associated with this transcoder.
protected boolean
isTextStroked()
Indicates whether text should be stroked rather than painted using text operators.
void
setEntityResolver(EntityResolver resolver)
Sets the EntityResolver that should be used when building SVG documents.
void
setLogger(Log logger)

Field Details

KEY_STROKE_TEXT

public static final TranscodingHints.Key KEY_STROKE_TEXT
The key to specify whether to stroke text instead of using text operations.

VALUE_FORMAT_OFF

public static final Boolean VALUE_FORMAT_OFF
The value to turn off text stroking.

VALUE_FORMAT_ON

public static final Boolean VALUE_FORMAT_ON
The value to turn on text stroking.

userAgent

protected UserAgent userAgent
The user agent dedicated to this Transcoder.

Constructor Details

AbstractFOPTranscoder

public AbstractFOPTranscoder()
Constructs a new FOP-style transcoder.

Method Details

createDocumentFactory

protected DocumentFactory createDocumentFactory(DOMImplementation domImpl,
                                                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.
Parameters:
domImpl - the DOM Implementation (not used)
parserClassname - the XML parser classname
Returns:
the document factory

createUserAgent

protected UserAgent createUserAgent()
Creates and returns the default user agent for this transcoder. Override this method if you need non-default behaviour.
Returns:
UserAgent the newly created user agent

getLogger

protected final Log getLogger()
Returns the logger associated with this transcoder. It returns a SimpleLog if no logger has been explicitly set.
Returns:
Logger the logger for the transcoder.

isTextStroked

protected boolean isTextStroked()
Indicates whether text should be stroked rather than painted using text operators. Stroking text (also referred to as "painting as shapes") can used in situations where the quality of text output is not satisfying. The downside of the work-around: The generated file will likely become bigger and you will lose copy/paste functionality for certain output formats such as PDF.
Returns:
true if text should be stroked rather than painted using text operators

setEntityResolver

public void setEntityResolver(EntityResolver resolver)
Sets the EntityResolver that should be used when building SVG documents.
Parameters:
resolver - the resolver

setLogger

public void setLogger(Log logger)
Parameters:
logger -

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