public final class FopFactory extends Object implements org.apache.xmlgraphics.image.loader.ImageContext
Modifier and Type | Method and Description |
---|---|
void |
addElementMapping(ElementMapping elementMapping)
Add the element mapping with the given class name.
|
ColorSpaceCache |
getColorSpaceCache()
Returns the color space cache for this instance.
|
ContentHandlerFactoryRegistry |
getContentHandlerFactoryRegistry() |
ElementMappingRegistry |
getElementMappingRegistry() |
FontManager |
getFontManager() |
Map<String,String> |
getHyphenationPatternNames() |
InternalResourceResolver |
getHyphenationResourceResolver() |
HyphenationTreeCache |
getHyphenationTreeCache() |
Set<String> |
getIgnoredNamespace() |
ImageHandlerRegistry |
getImageHandlerRegistry() |
org.apache.xmlgraphics.image.loader.ImageManager |
getImageManager() |
LayoutManagerMaker |
getLayoutManagerMakerOverride() |
String |
getPageHeight() |
String |
getPageWidth() |
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() |
Configuration |
getUserConfig()
Get the user configuration.
|
XMLHandlerRegistry |
getXMLHandlerRegistry() |
boolean |
isBreakIndentInheritanceOnReferenceAreaBoundary() |
boolean |
isNamespaceIgnored(String namespaceURI) |
Fop |
newFop(FOUserAgent userAgent)
Returns a new
Fop instance. |
Fop |
newFop(String outputFormat)
Returns a new
Fop instance. |
Fop |
newFop(String outputFormat,
FOUserAgent userAgent)
Returns a new
Fop instance. |
Fop |
newFop(String outputFormat,
FOUserAgent userAgent,
OutputStream stream)
Returns a new
Fop instance. |
Fop |
newFop(String outputFormat,
OutputStream stream)
Returns a new
Fop instance. |
FOUserAgent |
newFOUserAgent()
Returns a new FOUserAgent instance.
|
static FopFactory |
newInstance(File fopConf)
Returns a new FopFactory instance that is configured using the
FopFactoryConfig object that
is created when the fopConf is parsed. |
static FopFactory |
newInstance(FopFactoryConfig config)
FOP has the ability, for some FO's, to continue processing even if the
input XSL violates that FO's content model.
|
static FopFactory |
newInstance(URI baseURI)
Returns a new FopFactory instance that is configured only by the default configuration
parameters.
|
static FopFactory |
newInstance(URI baseURI,
InputStream confStream)
Returns a new FopFactory instance that is configured using the
FopFactoryConfig object that
is created when the fopConf is parsed. |
boolean |
validateStrictly() |
boolean |
validateUserConfigStrictly() |
public static FopFactory newInstance(FopFactoryConfig config)
FopFactoryConfig
object.config
- the fop configurationpublic static FopFactory newInstance(File fopConf) throws SAXException, IOException
FopFactoryConfig
object that
is created when the fopConf is parsed.fopConf
- the fop conf configuration file to parseIOException
SAXException
public static FopFactory newInstance(URI baseURI)
baseURI
- the base URI to resolve resource URIs againstpublic static FopFactory newInstance(URI baseURI, InputStream confStream) throws SAXException, IOException
FopFactoryConfig
object that
is created when the fopConf is parsed.baseURI
- the base URI to resolve resource URIs againstconfStream
- the fop conf configuration stream to parseSAXException
IOException
public FOUserAgent newFOUserAgent()
public Fop newFop(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(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 runFOPException
- when the constructor failspublic Fop newFop(String outputFormat, 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 streamFOPException
- when the constructor failspublic Fop newFop(String outputFormat, FOUserAgent userAgent, 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 streamFOPException
- 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 runFOPException
- when the constructor failspublic RendererFactory getRendererFactory()
public XMLHandlerRegistry getXMLHandlerRegistry()
public ImageHandlerRegistry getImageHandlerRegistry()
public ElementMappingRegistry getElementMappingRegistry()
public ContentHandlerFactoryRegistry getContentHandlerFactoryRegistry()
public void addElementMapping(ElementMapping elementMapping)
elementMapping
- the class name representing the element mapping.public org.apache.xmlgraphics.image.loader.ImageManager getImageManager()
FopFactoryConfig.getImageManager()
public LayoutManagerMaker getLayoutManagerMakerOverride()
public boolean validateStrictly()
FopFactoryConfig.validateStrictly()
public boolean isBreakIndentInheritanceOnReferenceAreaBoundary()
public float getSourceResolution()
getSourceResolution
in interface org.apache.xmlgraphics.image.loader.ImageContext
FopFactoryConfig.getSourceResolution()
public float getTargetResolution()
FopFactoryConfig.getTargetResolution()
public InternalResourceResolver getHyphenationResourceResolver()
public float getSourcePixelUnitToMillimeter()
getSourceResolution()
public float getTargetPixelUnitToMillimeter()
getTargetResolution()
public String getPageHeight()
FopFactoryConfig.getPageHeight()
public String getPageWidth()
FopFactoryConfig.getPageWidth()
public boolean isNamespaceIgnored(String namespaceURI)
public Set<String> getIgnoredNamespace()
FopFactoryConfig.getIgnoredNamespaces()
public Configuration getUserConfig()
public boolean validateUserConfigStrictly()
public FontManager getFontManager()
FopFactoryConfig.getFontManager()
public ColorSpaceCache getColorSpaceCache()
Note: this method should not be considered as part of FOP's external API.
public HyphenationTreeCache getHyphenationTreeCache()
Copyright © 2025 Apache Software Foundation. All rights reserved.