Constructor and Description |
---|
SvgDrawContext(ResourceResolver resourceResolver, FontProvider fontProvider)
Create an instance of the context that is used to store information when converting SVG.
|
SvgDrawContext(ResourceResolver resourceResolver, FontProvider fontProvider, ISvgNodeRenderer svgRootRenderer)
Create an instance of the context that is used to store information when converting SVG.
|
Modifier and Type | Method and Description |
---|---|
void |
addNamedObject(String name, ISvgNodeRenderer namedObject)
Adds a named object to the draw context.
|
void |
addNamedObjects(Map<String,ISvgNodeRenderer> namedObjects)
* Adds a number of named object to the draw context.
|
void |
addTextMove(float additionalMoveX, float additionalMoveY)
Increment the stored text move
|
void |
addUsedId(String elementId)
Adds an ID that has been referenced by a use element.
|
void |
addViewPort(Rectangle viewPort)
Adds a viewbox to the context.
|
PdfCanvas |
getCurrentCanvas()
Retrieves the current top of the stack, without modifying the stack.
|
AffineTransform |
getCurrentCanvasTransform()
Get the current canvas transformation
|
Rectangle |
getCurrentViewPort()
Get the current viewbox.
|
FontProvider |
getFontProvider()
Gets the FontProvider to be used during the drawing operations.
|
AffineTransform |
getLastTextTransform()
Get the text transformation that was last applied
|
ISvgNodeRenderer |
getNamedObject(String name)
Get a named object based on its name.
|
float |
getRemValue()
Return the value of root svg element font-size
|
ResourceResolver |
getResourceResolver()
Gets the ResourceResolver to be used during the drawing operations.
|
Rectangle |
getRootViewPort()
Get the viewbox which is the root viewport for the current document.
|
FontSet |
getTempFonts()
Gets list of temporary fonts from @font-face.
|
float[] |
getTextMove()
Get the stored current text move
|
boolean |
isIdUsedByUseTagBefore(String elementId)
Returns true when this id has been used before
|
PdfCanvas |
popCanvas()
Retrieves the current top of the stack, thereby taking the current item off the stack.
|
void |
pushCanvas(PdfCanvas canvas)
Adds a PdfCanvas to the stack (by definition its top), for use in drawing operations.
|
void |
removeCurrentViewPort()
Remove the currently set view box.
|
void |
removeUsedId(String elementId)
Removes an ID that has been referenced by a use element.
|
void |
resetTextMove()
Reset the stored text move to [0f,0f]
|
void |
setLastTextTransform(AffineTransform newTransform)
Set the last text transformation
|
void |
setTempFonts(FontSet tempFonts)
Sets the FontSet.
|
int |
size()
Get the current size of the stack, signifying the nesting level of the XObjects.
|
public SvgDrawContext(ResourceResolver resourceResolver, FontProvider fontProvider)
resourceResolver
- instance of ResourceResolver
fontProvider
- instance of FontProvider
public SvgDrawContext(ResourceResolver resourceResolver, FontProvider fontProvider, ISvgNodeRenderer svgRootRenderer)
resourceResolver
- instance of ResourceResolver
fontProvider
- instance of FontProvider
svgRootRenderer
- svg element that is root for current file
public PdfCanvas getCurrentCanvas()
public PdfCanvas popCanvas()
public void pushCanvas(PdfCanvas canvas)
PdfCanvas
to the stack (by definition its top), for use in drawing operations.
canvas
- the new top of the stack
public int size()
public void addViewPort(Rectangle viewPort)
viewPort
- rectangle representing the current viewbox
public Rectangle getCurrentViewPort()
public Rectangle getRootViewPort()
public void removeCurrentViewPort()
public void addNamedObject(String name, ISvgNodeRenderer namedObject)
name
- name of the object
namedObject
- object to be referenced
public ISvgNodeRenderer getNamedObject(String name)
name
- name of the object you want to reference
public ResourceResolver getResourceResolver()
public void addNamedObjects(Map<String,ISvgNodeRenderer> namedObjects)
namedObjects
- Map containing the named objects keyed to their ID strings
public FontProvider getFontProvider()
public FontSet getTempFonts()
public void setTempFonts(FontSet tempFonts)
tempFonts
- font set to be used during drawing operations
public boolean isIdUsedByUseTagBefore(String elementId)
elementId
- element id to check
public void addUsedId(String elementId)
elementId
- referenced element ID
public void removeUsedId(String elementId)
elementId
- referenced element ID
public AffineTransform getLastTextTransform()
AffineTransform
representing the last text transformation
public void setLastTextTransform(AffineTransform newTransform)
newTransform
- last text transformation
public float[] getTextMove()
public void resetTextMove()
public void addTextMove(float additionalMoveX, float additionalMoveY)
additionalMoveX
- horizontal value to add
additionalMoveY
- vertical value to add
public AffineTransform getCurrentCanvasTransform()
AffineTransform
representing the current canvas transformation
public float getRemValue()
Copyright © 1998–2020 iText Group NV. All rights reserved.