Package org.apache.fop.render.afp
Class AFPSVGHandler
java.lang.Object
org.apache.fop.render.AbstractGenericSVGHandler
org.apache.fop.render.afp.AFPSVGHandler
- All Implemented Interfaces:
RendererContextConstants
,XMLHandler
AFP XML handler for SVG. Uses Apache Batik for SVG processing.
This handler handles XML for foreign objects and delegates to AFPGraphics2DAdapter.
- See Also:
-
Field Summary
Fields inherited from interface org.apache.fop.render.RendererContextConstants
FOREIGN_ATTRIBUTES, HANDLER_CONFIGURATION, HEIGHT, OUTPUT_STREAM, PAGE_VIEWPORT, WIDTH, XPOS, YPOS
Fields inherited from interface org.apache.fop.render.XMLHandler
HANDLE_ALL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.batik.bridge.BridgeContext
createBridgeContext
(FOUserAgent userAgent, AFPGraphics2D g2d) void
handleXML
(RendererContext context, Document doc, String ns) Handle an external xml document inside a Foreign Object Area.protected void
renderSVGDocument
(RendererContext rendererContext, Document doc) Render the SVG document.boolean
supportsRenderer
(Renderer renderer) Checks if this XMLHandler supports handling an XML namespace for a particular renderer.protected void
updateRendererContext
(RendererContext context) Override this method to update the renderer context if it needs special settings for certain conditions.Methods inherited from class org.apache.fop.render.AbstractGenericSVGHandler
buildGraphicsNode, createGraphics2DImagePainter, getDocumentURI, getImageSize, getNamespace
-
Constructor Details
-
AFPSVGHandler
public AFPSVGHandler()
-
-
Method Details
-
handleXML
Handle an external xml document inside a Foreign Object Area.
This may throw an exception if for some reason it cannot be handled. The caller is expected to deal with this exception.
The implementation may convert the XML document internally to another XML dialect (SVG, for example) and call renderXML() on the AbstractRenderer again (which can be retrieved through the RendererContext).
- Specified by:
handleXML
in interfaceXMLHandler
- Overrides:
handleXML
in classAbstractGenericSVGHandler
- Parameters:
context
- The RendererContext (contains the user agent)doc
- A DOM containing the foreign object to be processedns
- The Namespace of the foreign object- Throws:
Exception
- If an error occurs during processing.
-
renderSVGDocument
Render the SVG document.- Overrides:
renderSVGDocument
in classAbstractGenericSVGHandler
- Parameters:
rendererContext
- the renderer contextdoc
- the SVG document- Throws:
IOException
- In case of an I/O error while painting the image
-
createBridgeContext
public static org.apache.batik.bridge.BridgeContext createBridgeContext(FOUserAgent userAgent, AFPGraphics2D g2d) - Parameters:
userAgent
- a user agent instanceg2d
- a graphics context- Returns:
- a bridge context
-
supportsRenderer
Checks if this XMLHandler supports handling an XML namespace for a particular renderer.- Parameters:
renderer
- the renderer for which to check.- Returns:
- true if this XML handler supports a particular renderer
-
updateRendererContext
Override this method to update the renderer context if it needs special settings for certain conditions.- Overrides:
updateRendererContext
in classAbstractGenericSVGHandler
- Parameters:
context
- the renderer context
-