public class SvgDrawContext extends Object
PdfCanvas instances, which
represent all levels of XObjects that are added to the root canvas.| Constructor and Description |
|---|
SvgDrawContext(com.itextpdf.styledxmlparser.resolver.resource.ResourceResolver resourceResolver,
com.itextpdf.layout.font.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(com.itextpdf.kernel.geom.Rectangle viewPort)
Adds a viewbox to the context.
|
com.itextpdf.kernel.pdf.canvas.PdfCanvas |
getCurrentCanvas()
Retrieves the current top of the stack, without modifying the stack.
|
com.itextpdf.kernel.geom.Rectangle |
getCurrentViewPort()
Get the current viewbox.
|
com.itextpdf.layout.font.FontProvider |
getFontProvider()
Gets the FontProvider to be used during the drawing operations.
|
ISvgNodeRenderer |
getNamedObject(String name)
Get a named object based on its name.
|
com.itextpdf.styledxmlparser.resolver.resource.ResourceResolver |
getResourceResolver()
Gets the ResourceResolver to be used during the drawing operations.
|
com.itextpdf.layout.font.FontSet |
getTempFonts()
Gets list of temporary fonts from @font-face.
|
boolean |
isIdUsedByUseTagBefore(String elementId)
Returns true when this id has been used before
|
com.itextpdf.kernel.pdf.canvas.PdfCanvas |
popCanvas()
Retrieves the current top of the stack, thereby taking the current item
off the stack.
|
void |
pushCanvas(com.itextpdf.kernel.pdf.canvas.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(com.itextpdf.layout.font.FontSet tempFonts)
Sets the FontSet.
|
int |
size()
Get the current size of the stack, signifying the nesting level of the
XObjects.
|
public SvgDrawContext(com.itextpdf.styledxmlparser.resolver.resource.ResourceResolver resourceResolver,
com.itextpdf.layout.font.FontProvider fontProvider)
public com.itextpdf.kernel.pdf.canvas.PdfCanvas getCurrentCanvas()
public com.itextpdf.kernel.pdf.canvas.PdfCanvas popCanvas()
public void pushCanvas(com.itextpdf.kernel.pdf.canvas.PdfCanvas canvas)
PdfCanvas to the stack (by definition its top), for use in
drawing operations.canvas - the new top of the stackpublic int size()
public void addViewPort(com.itextpdf.kernel.geom.Rectangle viewPort)
viewPort - rectangle representing the current viewboxpublic com.itextpdf.kernel.geom.Rectangle getCurrentViewPort()
public void removeCurrentViewPort()
public void addNamedObject(String name, ISvgNodeRenderer namedObject)
name - name of the objectnamedObject - object to be referencedpublic ISvgNodeRenderer getNamedObject(String name)
name - name of the object you want to referencepublic com.itextpdf.styledxmlparser.resolver.resource.ResourceResolver getResourceResolver()
public void addNamedObjects(Map<String,ISvgNodeRenderer> namedObjects)
namedObjects - Map containing the named objects keyed to their ID stringspublic com.itextpdf.layout.font.FontProvider getFontProvider()
public com.itextpdf.layout.font.FontSet getTempFonts()
public void setTempFonts(com.itextpdf.layout.font.FontSet tempFonts)
tempFonts - font set to be used during drawing operationspublic boolean isIdUsedByUseTagBefore(String elementId)
elementId - element id to checkpublic void addUsedId(String elementId)
elementId - referenced element IDpublic void removeUsedId(String elementId)
elementId - referenced element IDCopyright © 1998–2018 iText Group NV. All rights reserved.