Constructor and Description |
---|
SvgDrawContext(ResourceResolver resourceResolver, FontProvider fontProvider) |
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 |
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.
|
Rectangle |
getCurrentViewPort()
Get the current viewbox.
|
FontProvider |
getFontProvider()
Gets the FontProvider to be used during the drawing operations.
|
ISvgNodeRenderer |
getNamedObject(String name)
Get a named object based on its name.
|
ResourceResolver |
getResourceResolver()
Gets the ResourceResolver to be used during the drawing operations.
|
FontSet |
getTempFonts()
Gets list of temporary fonts from @font-face.
|
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 |
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)
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 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
Copyright © 1998–2019 iText Group NV. All rights reserved.