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)
Deprecated.
will be removed in 7.2, use
SvgDrawContext(ResourceResolver, FontProvider) instead
|
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.
|
SvgCssContext |
getCssContext()
Gets the SVG CSS 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[] |
getPreviousElementTextMove() |
float |
getRemValue()
Deprecated.
will be removed in 7.2, use
getCssContext() and SvgCssContext.getRootFontSize() instead
|
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 |
popPatternId()
Pops the last template id from the stack.
|
void |
pushCanvas(PdfCanvas canvas)
Adds a PdfCanvas to the stack (by definition its top), for use in drawing operations.
|
boolean |
pushPatternId(String patternId)
Add pattern id to stack.
|
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 |
setCssContext(SvgCssContext cssContext)
Sets the SVG CSS context.
|
void |
setLastTextTransform(AffineTransform newTransform)
Set the last text transformation
|
void |
setPreviousElementTextMove(float[] previousElementTextMove) |
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
@Deprecated public SvgDrawContext(ResourceResolver resourceResolver, FontProvider fontProvider, ISvgNodeRenderer svgRootRenderer)
SvgDrawContext(ResourceResolver, FontProvider)
instead
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
@Deprecated public float getRemValue()
getCssContext()
and SvgCssContext.getRootFontSize()
instead
public SvgCssContext getCssContext()
public void setCssContext(SvgCssContext cssContext)
cssContext
- the SVG CSS context
public boolean pushPatternId(String patternId)
false
and not add, if it is not - add and return true
.
patternId
- pattern id
true
if pattern id was not on the stack and was pushed; false
if it is on the stack
public void popPatternId()
public void setPreviousElementTextMove(float[] previousElementTextMove)
public float[] getPreviousElementTextMove()
Copyright © 1998–2023 iText Group NV. All rights reserved.