public class FOUserAgent extends Object
Renderer specific extensions (that do not produce normal areas on
the output) will be done like so:
The extension will create an area, custom if necessary
this area will be added to the user agent with a key
the renderer will know keys for particular extensions
eg. bookmarks will be held in a special hierarchical area representing
the title and bookmark structure
These areas may contain resolvable areas that will be processed
with other resolvable areas
Modifier and Type | Field and Description |
---|---|
protected String |
author
Author of the content of the document.
|
protected Date |
creationDate
Creation Date: Override of the date the document was created.
|
protected String |
creator
Creator: Metadata element for the user that created the
document.
|
protected String |
keywords
Set of keywords applicable to this document.
|
protected String |
producer
Producer: Metadata element for the system/software that produces
the document.
|
protected String |
subject
Subject of the document.
|
protected String |
title
Title of the document.
|
Modifier and Type | Method and Description |
---|---|
String |
getAuthor()
Returns the author of the document
|
ColorSpaceCache |
getColorSpaceCache() |
ContentHandlerFactoryRegistry |
getContentHandlerFactoryRegistry() |
Date |
getCreationDate()
Returns the creation date of the document
|
String |
getCreator()
Returns the creator of the document
|
IFDocumentHandler |
getDocumentHandlerOverride()
Returns the overriding
IFDocumentHandler instance, if any. |
ElementMappingRegistry |
getElementMappingRegistry() |
EventBroadcaster |
getEventBroadcaster()
Returns the event broadcaster that control events sent inside a processing run.
|
FOEventHandler |
getFOEventHandlerOverride()
Returns the overriding FOEventHandler instance, if any.
|
FontManager |
getFontManager() |
Map<String,String> |
getHyphenationPatternNames() |
InternalResourceResolver |
getHyphenationResourceResolver() |
HyphenationTreeCache |
getHyphenationTreeCache() |
ImageHandlerRegistry |
getImageHandlerRegistry() |
org.apache.xmlgraphics.image.loader.ImageManager |
getImageManager() |
org.apache.xmlgraphics.image.loader.ImageSessionContext |
getImageSessionContext()
Returns the image session context for the image package.
|
String |
getKeywords()
Returns the keywords for the document
|
LayoutManagerMaker |
getLayoutManagerMakerOverride() |
File |
getOutputFile()
Gets the output File.
|
String |
getPageHeight()
Gets the default page-height to use as fallback,
in case page-height="auto"
|
String |
getPageWidth()
Gets the default page-width to use as fallback,
in case page-width="auto"
|
org.apache.xmlgraphics.image.loader.util.SoftMapCache |
getPDFObjectCache() |
String |
getProducer()
Returns the producer of the document
|
RendererConfig |
getRendererConfig(String mimeType,
RendererConfig.RendererConfigParser configCreator)
Returns the renderer configuration object for a particular MIME type.
|
Configuration |
getRendererConfiguration(String mimeType)
Returns a
Configuration object for which contains renderer configuration for a given
MIME type. |
RendererFactory |
getRendererFactory() |
Object |
getRendererOption(RendererConfigOption option)
Gets the renderer options given an interface representing renderer configuration options.
|
Map |
getRendererOptions()
Returns the renderer options
|
Renderer |
getRendererOverride()
Returns the overriding Renderer instance, if any.
|
InternalResourceResolver |
getResourceResolver()
Returns the resource resolver.
|
float |
getSourcePixelUnitToMillimeter()
Returns the conversion factor from pixel units to millimeters.
|
float |
getSourceResolution() |
StructureTreeEventHandler |
getStructureTreeEventHandler()
Returns the document's structure tree event handler, for use by
accessible output formats.
|
String |
getSubject()
Returns the subject of the document
|
float |
getTargetPixelUnitToMillimeter()
Returns the conversion factor from pixel units to millimeters.
|
float |
getTargetResolution() |
String |
getTitle()
Returns the title of the document
|
Configuration |
getUserConfig()
Get the user configuration.
|
XMLHandlerRegistry |
getXMLHandlerRegistry() |
boolean |
isAccessibilityEnabled()
Check if accessibility is enabled.
|
boolean |
isBreakIndentInheritanceOnReferenceAreaBoundary() |
boolean |
isComplexScriptFeaturesEnabled()
Check whether complex script features are enabled.
|
boolean |
isConserveMemoryPolicyEnabled()
Check whether memory-conservation is enabled.
|
boolean |
isKeepEmptyTags() |
boolean |
isLegacyFoWrapper() |
boolean |
isLegacyLastPageChangeIPD() |
boolean |
isLegacySkipPagePositionOnly() |
boolean |
isLocatorEnabled()
Checks if the use of Locators is enabled
|
boolean |
isNamespaceIgnored(String namespaceURI)
Indicates whether a namespace URI is on the ignored list.
|
boolean |
isPdfUAEnabled() |
boolean |
isSimpleLineBreaking() |
boolean |
isSkipPagePositionOnlyAllowed() |
boolean |
isStaticRegionsPerPageForAccessibility() |
boolean |
isTableBorderOverpaint() |
Fop |
newFop(String outputFormat)
Returns a new
Fop instance. |
Fop |
newFop(String outputFormat,
OutputStream stream)
Returns a new
Fop instance. |
StreamSource |
resolveURI(String uri)
Attempts to resolve the given URI.
|
void |
setAccessibility(boolean accessibility)
Activates accessibility (for output formats that support it).
|
void |
setAuthor(String author)
Sets the author of the document.
|
void |
setConserveMemoryPolicy(boolean conserveMemoryPolicy)
Control whether memory-conservation should be enabled
|
void |
setCreationDate(Date creationDate)
Sets the creation date of the document.
|
void |
setCreator(String creator)
Sets the creator of the document.
|
void |
setDocumentHandlerOverride(IFDocumentHandler documentHandler)
Sets an explicit document handler to use which overrides the one that would be
selected by default.
|
void |
setFOEventHandlerOverride(FOEventHandler handler)
Sets an explicit FOEventHandler instance which overrides the one
defined by the render type setting.
|
void |
setKeepEmptyTags(boolean b) |
void |
setKeywords(String keywords)
Sets the keywords for the document.
|
void |
setLocatorEnabled(boolean enableLocator)
Controls the use of SAXLocators to provide location information in error
messages.
|
void |
setOutputFile(File f)
Sets the output File.
|
void |
setPdfUAEnabled(boolean pdfUAEnabled) |
void |
setProducer(String producer)
Sets the producer of the document.
|
void |
setRendererOverride(Renderer renderer)
Sets an explicit renderer to use which overrides the one defined by the
render type setting.
|
void |
setStaticRegionsPerPageForAccessibility(boolean staticRegionsPerPageForAccessibility) |
void |
setStructureTreeEventHandler(StructureTreeEventHandler structureTreeEventHandler)
Sets the document's structure tree event handler, for use by accessible
output formats.
|
void |
setSubject(String subject)
Sets the subject of the document.
|
void |
setTargetResolution(float dpi)
Sets the target resolution in dpi.
|
void |
setTargetResolution(int dpi)
Sets the target resolution in dpi.
|
void |
setTitle(String title)
Sets the title of the document.
|
boolean |
validateStrictly()
Returns whether FOP is strictly validating input XSL
|
boolean |
validateUserConfigStrictly()
Is the user configuration to be validated?
|
protected String producer
protected String creator
protected Date creationDate
protected String author
protected String title
protected String subject
protected String keywords
public Fop newFop(String outputFormat, 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").stream
- the output streamFOPException
- when the constructor failspublic Fop newFop(String outputFormat) 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").FOPException
- when the constructor failspublic InternalResourceResolver getResourceResolver()
public void setDocumentHandlerOverride(IFDocumentHandler documentHandler)
documentHandler
- the document handler instance to usepublic IFDocumentHandler getDocumentHandlerOverride()
IFDocumentHandler
instance, if any.public void setRendererOverride(Renderer renderer)
renderer
- the Renderer instance to usepublic Renderer getRendererOverride()
public void setFOEventHandlerOverride(FOEventHandler handler)
handler
- the FOEventHandler instancepublic FOEventHandler getFOEventHandlerOverride()
public void setProducer(String producer)
producer
- source of documentpublic String getProducer()
public void setCreator(String creator)
creator
- of documentpublic String getCreator()
public void setCreationDate(Date creationDate)
creationDate
- date of documentpublic Date getCreationDate()
public void setAuthor(String author)
author
- of documentpublic String getAuthor()
public void setTitle(String title)
title
- of documentpublic String getTitle()
public void setSubject(String subject)
subject
- of documentpublic String getSubject()
public void setKeywords(String keywords)
keywords
- for the documentpublic String getKeywords()
public Map getRendererOptions()
public Object getRendererOption(RendererConfigOption option)
option
- the renderer optionpublic StreamSource resolveURI(String uri)
uri
- URI to accessSource
object, or null if the URI
cannot be resolved.public void setOutputFile(File f)
f
- the output Filepublic File getOutputFile()
public float getTargetPixelUnitToMillimeter()
getTargetResolution()
public float getTargetResolution()
public void setTargetResolution(float dpi)
dpi
- resolution in dpipublic void setTargetResolution(int dpi)
dpi
- resolution in dpipublic org.apache.xmlgraphics.image.loader.ImageSessionContext getImageSessionContext()
public float getSourcePixelUnitToMillimeter()
getSourceResolution()
public float getSourceResolution()
public String getPageHeight()
FopFactory.getPageHeight()
public String getPageWidth()
FopFactory.getPageWidth()
public boolean validateStrictly()
FopFactory.validateStrictly()
public boolean isBreakIndentInheritanceOnReferenceAreaBoundary()
FopFactory.isBreakIndentInheritanceOnReferenceAreaBoundary()
public RendererFactory getRendererFactory()
public XMLHandlerRegistry getXMLHandlerRegistry()
public void setLocatorEnabled(boolean enableLocator)
enableLocator
- false
if SAX Locators should be disabledpublic boolean isLocatorEnabled()
public EventBroadcaster getEventBroadcaster()
public boolean isPdfUAEnabled()
public void setPdfUAEnabled(boolean pdfUAEnabled)
public boolean isConserveMemoryPolicyEnabled()
public void setConserveMemoryPolicy(boolean conserveMemoryPolicy)
conserveMemoryPolicy
- the cachingEnabled to setpublic boolean isComplexScriptFeaturesEnabled()
public RendererConfig getRendererConfig(String mimeType, RendererConfig.RendererConfigParser configCreator) throws FOPException
mimeType
- the config MIME typeconfigCreator
- the parser for creating the config for the first run of parsing.FOPException
- if an error occurs when creating the config objectpublic Configuration getRendererConfiguration(String mimeType)
Configuration
object for which contains renderer configuration for a given
MIME type.mimeType
- the renderer configuration MIME typepublic void setAccessibility(boolean accessibility)
accessibility
- true
to enable accessibility supportpublic boolean isAccessibilityEnabled()
public void setStaticRegionsPerPageForAccessibility(boolean staticRegionsPerPageForAccessibility)
public boolean isStaticRegionsPerPageForAccessibility()
public void setStructureTreeEventHandler(StructureTreeEventHandler structureTreeEventHandler)
structureTreeEventHandler
- The structure tree event handler to setpublic StructureTreeEventHandler getStructureTreeEventHandler()
public LayoutManagerMaker getLayoutManagerMakerOverride()
public ContentHandlerFactoryRegistry getContentHandlerFactoryRegistry()
public org.apache.xmlgraphics.image.loader.ImageManager getImageManager()
FopFactory.getImageManager()
public ElementMappingRegistry getElementMappingRegistry()
FopFactory.getElementMappingRegistry()
public FontManager getFontManager()
FopFactory.getFontManager()
public boolean isNamespaceIgnored(String namespaceURI)
namespaceURI
- the namespace URIpublic boolean validateUserConfigStrictly()
public Configuration getUserConfig()
public ImageHandlerRegistry getImageHandlerRegistry()
public ColorSpaceCache getColorSpaceCache()
public Map<String,String> getHyphenationPatternNames()
FopFactory.getHyphenationPatternNames()
public InternalResourceResolver getHyphenationResourceResolver()
public org.apache.xmlgraphics.image.loader.util.SoftMapCache getPDFObjectCache()
public HyphenationTreeCache getHyphenationTreeCache()
public void setKeepEmptyTags(boolean b)
public boolean isKeepEmptyTags()
public boolean isTableBorderOverpaint()
public boolean isSimpleLineBreaking()
public boolean isSkipPagePositionOnlyAllowed()
public boolean isLegacySkipPagePositionOnly()
public boolean isLegacyLastPageChangeIPD()
public boolean isLegacyFoWrapper()
Copyright © 2025 Apache Software Foundation. All rights reserved.