public class SvgImageXObject
extends com.itextpdf.kernel.pdf.xobject.PdfFormXObject
| Constructor and Description |
|---|
SvgImageXObject(ISvgProcessorResult result,
SvgDrawContext svgContext,
float em,
com.itextpdf.kernel.pdf.PdfDocument pdfDocument)
Creates a new instance of Form XObject for the relative sized SVG image.
|
SvgImageXObject(com.itextpdf.kernel.geom.Rectangle bBox,
ISvgProcessorResult result,
ResourceResolver resourceResolver)
Creates a new instance of Form XObject for the SVG image.
|
| Modifier and Type | Method and Description |
|---|---|
void |
generate(com.itextpdf.kernel.pdf.PdfDocument document)
Processes xObject before first image generation to avoid drawing it twice or more.
|
UnitValue |
getElementHeight()
Gets the SVG element height.
|
UnitValue |
getElementWidth()
Gets the SVG element width.
|
ResourceResolver |
getResourceResolver()
Deprecated.
not used anymore
|
ISvgProcessorResult |
getResult()
Returns processor result containing the SVG information.
|
boolean |
isCreatedByImg()
Check if SVG image is created from HTML img tag context
|
boolean |
isCreatedByObject()
Check if SVG image is created from HTML object tag context
|
boolean |
isRelativeSized()
If the SVG image is relative sized.
|
void |
setIsCreatedByImg(boolean isCreatedByImg)
Set if SVG image is created from HTML img tag context
|
void |
setIsCreatedByObject(boolean isCreatedByObject)
Set if SVG image is created from HTML object tag context
|
void |
updateBBox(float areaWidth,
float areaHeight)
Updated XObject BBox for relative sized SVG image.
|
calcAppearanceTransformToAnnotRect, calculateBBoxMultipliedByMatrix, flush, getBBox, getHeight, getMarkStyle, getProcessColorModel, getResources, getSeparationColorNames, getTrapRegions, getTrapStyles, getWidth, put, setBBox, setGroup, setMarkStyle, setProcessColorModel, setSeparationColorNames, setTrapRegions, setTrapStylesaddAssociatedFile, calculateProportionallyFitRectangleWithHeight, calculateProportionallyFitRectangleWithWidth, getAssociatedFiles, isWrappedObjectMustBeIndirect, makeXObject, setLayerpublic SvgImageXObject(com.itextpdf.kernel.geom.Rectangle bBox,
ISvgProcessorResult result,
ResourceResolver resourceResolver)
bBox - the form XObject’s bounding box.result - processor result containing the SVG information.resourceResolver - ResourceResolver for the SVG image.public SvgImageXObject(ISvgProcessorResult result, SvgDrawContext svgContext, float em, com.itextpdf.kernel.pdf.PdfDocument pdfDocument)
result - processor result containing the SVG informationsvgContext - the svg draw contextem - em value in ptpdfDocument - pdf that shall contain the SVG image, can be nullpublic void setIsCreatedByImg(boolean isCreatedByImg)
isCreatedByImg - true if object is created from HTML img tag, false otherwisepublic boolean isCreatedByImg()
public void setIsCreatedByObject(boolean isCreatedByObject)
isCreatedByObject - true if object is created from HTML object tag, false otherwisepublic boolean isCreatedByObject()
public boolean isRelativeSized()
isRelativeSized in class com.itextpdf.kernel.pdf.xobject.PdfFormXObjecttrue if the SVG image is relative sized, false otherwiseupdateBBox(float, float),
SvgImageXObject(ISvgProcessorResult, SvgDrawContext, float, PdfDocument)public ISvgProcessorResult getResult()
@Deprecated public ResourceResolver getResourceResolver()
ResourceResolver instancepublic void generate(com.itextpdf.kernel.pdf.PdfDocument document)
document - pdf that shall contain the SVG image, can be null if constructor
SvgImageXObject(ISvgProcessorResult, SvgDrawContext, float, PdfDocument) was usedpublic void updateBBox(float areaWidth,
float areaHeight)
areaWidth - the area width where SVG image will be drawnareaHeight - the area height where SVG image will be drawnpublic UnitValue getElementWidth()
public UnitValue getElementHeight()
Copyright © 1998–2025 Apryse Group NV. All rights reserved.