Package com.itextpdf.svg.renderers
Interface ISvgNodeRenderer
- All Known Subinterfaces:
-
IBranchSvgNodeRenderer
,INoDrawSvgNodeRenderer
,ISvgPaintServer
,ISvgTextNodeRenderer
- All Known Implementing Classes:
-
AbstractBranchSvgNodeRenderer
,AbstractContainerSvgNodeRenderer
,AbstractGradientSvgNodeRenderer
,AbstractSvgNodeRenderer
,CircleSvgNodeRenderer
,ClipPathSvgNodeRenderer
,DefsSvgNodeRenderer
,EllipseSvgNodeRenderer
,GroupSvgNodeRenderer
,ImageSvgNodeRenderer
,LinearGradientSvgNodeRenderer
,LineSvgNodeRenderer
,MarkerSvgNodeRenderer
,PathSvgNodeRenderer
,PatternSvgNodeRenderer
,PdfRootSvgNodeRenderer
,PolygonSvgNodeRenderer
,PolylineSvgNodeRenderer
,RectangleSvgNodeRenderer
,StopSvgNodeRenderer
,SvgTagSvgNodeRenderer
,SymbolSvgNodeRenderer
,TextLeafSvgNodeRenderer
,TextSvgBranchRenderer
,TextSvgTSpanBranchRenderer
,UseSvgNodeRenderer
public interface ISvgNodeRenderer
Interface for SvgNodeRenderer, the renderer draws the SVG to its Pdf-canvas passed in
SvgDrawContext
, applying styling (CSS and attributes).
-
Method Summary
Modifier and TypeMethodDescriptionCreates a deep copy of this renderer, including it's subtree of childrenvoid
draw
(SvgDrawContext context) Draws this element to a canvas-like object maintained in the context.getAttribute
(String key) Retrieves the property value for a given key name.Get a modifiable copy of the style and attribute mapgetObjectBoundingBox
(SvgDrawContext context) Calculates the current object bounding box.Gets the parent of this renderer.void
setAttribute
(String key, String value) Sets a property key and value pairs for a given attributevoid
setAttributesAndStyles
(Map<String, String> attributesAndStyles) Sets the map of XML node attributes and CSS style properties that this renderer needs.void
setParent
(ISvgNodeRenderer parent) Sets the parent of this renderer.
-
Method Details
-
setParent
Sets the parent of this renderer. The parent may be the source of inherited properties and default values.- Parameters:
-
parent
- the parent renderer
-
getParent
ISvgNodeRenderer getParent()Gets the parent of this renderer. The parent may be the source of inherited properties and default values.- Returns:
- the parent renderer; null in case of a root node
-
draw
Draws this element to a canvas-like object maintained in the context.- Parameters:
-
context
- the object that knows the place to draw this element and maintains its state
-
setAttributesAndStyles
Sets the map of XML node attributes and CSS style properties that this renderer needs.- Parameters:
-
attributesAndStyles
- the mapping from key names to values
-
getAttribute
Retrieves the property value for a given key name.- Parameters:
-
key
- the name of the property to search for - Returns:
-
the value for this key, or
null
-
setAttribute
Sets a property key and value pairs for a given attribute- Parameters:
-
key
- the name of the attribute -
value
- the value of the attribute
-
getAttributeMapCopy
Get a modifiable copy of the style and attribute map- Returns:
- copy of the attributes and styles-map
-
createDeepCopy
ISvgNodeRenderer createDeepCopy()Creates a deep copy of this renderer, including it's subtree of children- Returns:
- deep copy of this renderer
-
getObjectBoundingBox
Calculates the current object bounding box.- Parameters:
-
context
- the current context, for instance it contains current viewport and available font data - Returns:
-
the
Rectangle
representing the current object's bounding box, or null if bounding box is undefined
-