|
fop 1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fop.apps.FopFactory
public class FopFactory
Factory class which instantiates new Fop and FOUserAgent instances. This class also holds environmental information and configuration used by FOP. Information that may potentially be different for each rendering run can be found and managed in the FOUserAgent.
Constructor Summary | |
---|---|
protected |
FopFactory()
Main constructor. |
Method Summary | |
---|---|
void |
addElementMapping(ElementMapping elementMapping)
Add the element mapping with the given class name. |
java.lang.String |
getBaseURL()
Returns the base URL. |
java.awt.color.ColorSpace |
getColorSpace(java.lang.String baseUri,
java.lang.String iccProfileSrc)
Create (if needed) and return an ICC ColorSpace instance. |
ContentHandlerFactoryRegistry |
getContentHandlerFactoryRegistry()
|
ElementMappingRegistry |
getElementMappingRegistry()
|
java.lang.String |
getFontBaseURL()
Deprecated. use getFontManager().setFontBaseURL(fontBase) instead |
FontCache |
getFontCache()
Deprecated. use getFontManager().getFontCache() instead |
FontManager |
getFontManager()
Returns the font manager. |
FOURIResolver |
getFOURIResolver()
Returns the FO URI Resolver. |
HyphenationTreeResolver |
getHyphenationTreeResolver()
|
java.lang.String |
getHyphenBaseURL()
|
java.util.Set |
getIgnoredNamespace()
|
ImageHandlerRegistry |
getImageHandlerRegistry()
|
org.apache.xmlgraphics.image.loader.ImageManager |
getImageManager()
Returns the image manager. |
LayoutManagerMaker |
getLayoutManagerMakerOverride()
Returns the overriding LayoutManagerMaker instance, if any. |
java.lang.String |
getPageHeight()
Gets the default page-height to use as fallback, in case page-height="auto" |
java.lang.String |
getPageWidth()
Gets the default page-width to use as fallback, in case page-width="auto" |
RendererFactory |
getRendererFactory()
|
float |
getSourcePixelUnitToMillimeter()
Returns the conversion factor from pixel units to millimeters. |
float |
getSourceResolution()
|
float |
getTargetPixelUnitToMillimeter()
Returns the conversion factor from pixel units to millimeters. |
float |
getTargetResolution()
|
javax.xml.transform.URIResolver |
getURIResolver()
Returns the URI Resolver. |
org.apache.avalon.framework.configuration.Configuration |
getUserConfig()
Get the user configuration. |
XMLHandlerRegistry |
getXMLHandlerRegistry()
|
void |
ignoreNamespace(java.lang.String namespaceURI)
Adds a namespace to the set of ignored namespaces. |
void |
ignoreNamespaces(java.util.Collection namespaceURIs)
Adds a collection of namespaces to the set of ignored namespaces. |
boolean |
isBase14KerningEnabled()
Deprecated. use getFontManager().isBase14KerningEnabled() instead |
boolean |
isBreakIndentInheritanceOnReferenceAreaBoundary()
|
boolean |
isNamespaceIgnored(java.lang.String namespaceURI)
Indicates whether a namespace URI is on the ignored list. |
Fop |
newFop(FOUserAgent userAgent)
Returns a new Fop instance. |
Fop |
newFop(java.lang.String outputFormat)
Returns a new Fop instance. |
Fop |
newFop(java.lang.String outputFormat,
FOUserAgent userAgent)
Returns a new Fop instance. |
Fop |
newFop(java.lang.String outputFormat,
FOUserAgent userAgent,
java.io.OutputStream stream)
Returns a new Fop instance. |
Fop |
newFop(java.lang.String outputFormat,
java.io.OutputStream stream)
Returns a new Fop instance. |
FOUserAgent |
newFOUserAgent()
Returns a new FOUserAgent instance. |
static FopFactory |
newInstance()
Returns a new FopFactory instance. |
javax.xml.transform.Source |
resolveURI(java.lang.String href,
java.lang.String baseUri)
Attempts to resolve the given URI. |
void |
setBase14KerningEnabled(boolean value)
Deprecated. use getFontManager().setBase14KerningEnabled(boolean) instead |
void |
setBaseURL(java.lang.String base)
Sets the base URL. |
void |
setBreakIndentInheritanceOnReferenceAreaBoundary(boolean value)
Controls whether to enable a feature that breaks indent inheritance when crossing reference area boundaries. |
void |
setFontBaseURL(java.lang.String fontBase)
Deprecated. use getFontManager().setFontBaseURL(fontBase) instead |
void |
setHyphenationTreeResolver(HyphenationTreeResolver hyphResolver)
Sets the HyphenationTreeResolver to be used for resolving user-supplied hyphenation files. |
void |
setHyphenBaseURL(java.lang.String hyphenBase)
Sets the hyphen base URL. |
void |
setLayoutManagerMakerOverride(LayoutManagerMaker lmMaker)
Sets an explicit LayoutManagerMaker instance which overrides the one defined by the AreaTreeHandler. |
void |
setPageHeight(java.lang.String pageHeight)
Sets the page-height to use as fallback, in case page-height="auto" |
void |
setPageWidth(java.lang.String pageWidth)
Sets the page-width to use as fallback, in case page-width="auto" |
void |
setSourceResolution(float dpi)
Sets the source resolution in dpi. |
void |
setSourceResolution(int dpi)
Sets the source resolution in dpi. |
void |
setStrictUserConfigValidation(boolean strictUserConfigValidation)
Is the user configuration to be validated? |
void |
setStrictValidation(boolean validateStrictly)
Activates strict XSL content model validation for FOP Default is false (FOP will continue processing where it can) |
void |
setTargetResolution(float dpi)
Sets the source resolution in dpi. |
void |
setURIResolver(javax.xml.transform.URIResolver uriResolver)
Sets the URI Resolver. |
void |
setUseCache(boolean useCache)
Deprecated. use getFontManager().setUseCache(boolean) instead |
void |
setUserConfig(org.apache.avalon.framework.configuration.Configuration userConfig)
Set the user configuration. |
void |
setUserConfig(java.io.File userConfigFile)
Set the user configuration. |
void |
setUserConfig(java.lang.String uri)
Set the user configuration from an URI. |
boolean |
useCache()
Deprecated. use getFontManager().useCache() instead |
boolean |
validateStrictly()
Returns whether FOP is strictly validating input XSL |
boolean |
validateUserConfigStrictly()
Is the user configuration to be validated? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected FopFactory()
Method Detail |
---|
public static FopFactory newInstance()
public FOUserAgent newFOUserAgent()
FOPException
public Fop newFop(java.lang.String outputFormat) throws FOPException
Fop
instance. FOP will be configured with a default user agent
instance.
MIME types are used to select the output format (ex. "application/pdf" for PDF). You can
use the constants defined in MimeConstants
.
outputFormat
- the MIME type of the output format to use (ex. "application/pdf").
FOPException
- when the constructor failspublic Fop newFop(java.lang.String outputFormat, FOUserAgent userAgent) throws FOPException
Fop
instance. Use this factory method if you want to configure this
very rendering run, i.e. if you want to set some metadata like the title and author of the
document you want to render. In that case, create a new FOUserAgent
instance using newFOUserAgent()
.
MIME types are used to select the output format (ex. "application/pdf" for PDF). You can
use the constants defined in MimeConstants
.
outputFormat
- the MIME type of the output format to use (ex. "application/pdf").userAgent
- the user agent that will be used to control the rendering run
FOPException
- when the constructor failspublic Fop newFop(java.lang.String outputFormat, java.io.OutputStream stream) throws FOPException
Fop
instance. FOP will be configured with a default user agent
instance. Use this factory method if your output type requires an output stream.
MIME types are used to select the output format (ex. "application/pdf" for PDF). You can
use the constants defined in MimeConstants
.
outputFormat
- the MIME type of the output format to use (ex. "application/pdf").stream
- the output stream
FOPException
- when the constructor failspublic Fop newFop(java.lang.String outputFormat, FOUserAgent userAgent, java.io.OutputStream stream) throws FOPException
Fop
instance. Use this factory method if your output type
requires an output stream and you want to configure this very rendering run,
i.e. if you want to set some metadata like the title and author of the document
you want to render. In that case, create a new FOUserAgent
instance
using newFOUserAgent()
.
MIME types are used to select the output format (ex. "application/pdf" for PDF). You can
use the constants defined in MimeConstants
.
outputFormat
- the MIME type of the output format to use (ex. "application/pdf").userAgent
- the user agent that will be used to control the rendering runstream
- the output stream
FOPException
- when the constructor failspublic Fop newFop(FOUserAgent userAgent) throws FOPException
Fop
instance. Use this factory method if you want to supply your
own Renderer
or
FOEventHandler
instance instead of the default ones created internally by FOP.
userAgent
- the user agent that will be used to control the rendering run
FOPException
- when the constructor failspublic RendererFactory getRendererFactory()
public XMLHandlerRegistry getXMLHandlerRegistry()
public ImageHandlerRegistry getImageHandlerRegistry()
public ElementMappingRegistry getElementMappingRegistry()
public ContentHandlerFactoryRegistry getContentHandlerFactoryRegistry()
public org.apache.xmlgraphics.image.loader.ImageManager getImageManager()
public void addElementMapping(ElementMapping elementMapping)
elementMapping
- the class name representing the element mapping.public void setLayoutManagerMakerOverride(LayoutManagerMaker lmMaker)
lmMaker
- the LayoutManagerMaker instancepublic LayoutManagerMaker getLayoutManagerMakerOverride()
public void setBaseURL(java.lang.String base) throws java.net.MalformedURLException
base
- the base URL
java.net.MalformedURLException
- if there's a problem with a file URLpublic java.lang.String getBaseURL()
public void setFontBaseURL(java.lang.String fontBase) throws java.net.MalformedURLException
fontBase
- font base URL
java.net.MalformedURLException
- if there's a problem with a file URLpublic java.lang.String getFontBaseURL()
public java.lang.String getHyphenBaseURL()
public void setHyphenBaseURL(java.lang.String hyphenBase) throws java.net.MalformedURLException
hyphenBase
- hythen base URL
java.net.MalformedURLException
- if there's a problem with a file URLpublic void setURIResolver(javax.xml.transform.URIResolver uriResolver)
uriResolver
- the new URI resolverpublic javax.xml.transform.URIResolver getURIResolver()
public FOURIResolver getFOURIResolver()
public HyphenationTreeResolver getHyphenationTreeResolver()
public void setHyphenationTreeResolver(HyphenationTreeResolver hyphResolver)
hyphResolver
- the HyphenationTreeResolver instancepublic void setStrictValidation(boolean validateStrictly)
validateStrictly
- true to turn on strict validationpublic boolean validateStrictly()
public boolean isBreakIndentInheritanceOnReferenceAreaBoundary()
public void setBreakIndentInheritanceOnReferenceAreaBoundary(boolean value)
This flag controls whether FOP will enable special code that breaks property inheritance for start-indent and end-indent when the evaluation of the inherited value would cross a reference area. This is described under http://wiki.apache.org/xmlgraphics-fop/IndentInheritance as is intended to improve interoperability with commercial FO implementations and to produce results that are more in line with the expectation of unexperienced FO users. Note: Enabling this features violates the XSL specification!
value
- true to enable the featurepublic boolean isBase14KerningEnabled()
public void setBase14KerningEnabled(boolean value)
value
- true if kerning should be activatedpublic float getSourceResolution()
getSourceResolution
in interface org.apache.xmlgraphics.image.loader.ImageContext
public float getSourcePixelUnitToMillimeter()
getSourceResolution()
public void setSourceResolution(float dpi)
dpi
- resolution in dpipublic float getTargetResolution()
public float getTargetPixelUnitToMillimeter()
getTargetResolution()
public void setTargetResolution(float dpi)
dpi
- resolution in dpipublic void setSourceResolution(int dpi)
dpi
- resolution in dpipublic java.lang.String getPageHeight()
public void setPageHeight(java.lang.String pageHeight)
pageHeight
- page-height as a Stringpublic java.lang.String getPageWidth()
public void setPageWidth(java.lang.String pageWidth)
pageWidth
- page-width as a Stringpublic void ignoreNamespace(java.lang.String namespaceURI)
namespaceURI
- the namespace URIpublic void ignoreNamespaces(java.util.Collection namespaceURIs)
namespaceURIs
- the namespace URIspublic boolean isNamespaceIgnored(java.lang.String namespaceURI)
namespaceURI
- the namespace URI
public java.util.Set getIgnoredNamespace()
public void setUserConfig(java.io.File userConfigFile) throws org.xml.sax.SAXException, java.io.IOException
userConfigFile
- the configuration file
java.io.IOException
- if an I/O error occurs
org.xml.sax.SAXException
- if a parsing error occurspublic void setUserConfig(java.lang.String uri) throws org.xml.sax.SAXException, java.io.IOException
uri
- the URI to the configuration file
java.io.IOException
- if an I/O error occurs
org.xml.sax.SAXException
- if a parsing error occurspublic void setUserConfig(org.apache.avalon.framework.configuration.Configuration userConfig) throws FOPException
userConfig
- configuration
FOPException
- if a configuration problem occurspublic org.apache.avalon.framework.configuration.Configuration getUserConfig()
public void setStrictUserConfigValidation(boolean strictUserConfigValidation)
strictUserConfigValidation
- strict user config validationpublic boolean validateUserConfigStrictly()
public void setUseCache(boolean useCache)
useCache
- use cache or notpublic boolean useCache()
public FontCache getFontCache()
public FontManager getFontManager()
public javax.xml.transform.Source resolveURI(java.lang.String href, java.lang.String baseUri)
href
- URI to accessbaseUri
- the base URI to resolve against
Source
object, or null if the URI
cannot be resolved.FOURIResolver
public java.awt.color.ColorSpace getColorSpace(java.lang.String baseUri, java.lang.String iccProfileSrc)
baseUri
- a base URI to resolve relative URIsiccProfileSrc
- ICC Profile source to return a ColorSpace for
|
fop 1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |