public final class SvgCssUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
convertDoubleToString(double value)
Deprecated.
can be replaced by
Double.toString(float) |
static String |
convertFloatToString(float value)
Deprecated.
can be replaced by
Float.toString(float) |
static com.itextpdf.kernel.geom.Rectangle |
extractWidthAndHeight(ISvgNodeRenderer svgRenderer,
float em,
SvgDrawContext context)
Extract width and height of the passed SVGNodeRenderer, defaulting to
SvgDrawContext.getCustomViewport()
if either one is not present. |
static float |
parseAbsoluteHorizontalLength(AbstractSvgNodeRenderer svgNodeRenderer,
String length,
float defaultValue,
SvgDrawContext context)
Parses horizontal length attribute and converts it to an absolute value.
|
static float |
parseAbsoluteLength(AbstractSvgNodeRenderer svgNodeRenderer,
String length,
float percentBaseValue,
float defaultValue,
SvgDrawContext context)
Parse length attribute and convert it to an absolute value.
|
static float |
parseAbsoluteVerticalLength(AbstractSvgNodeRenderer svgNodeRenderer,
String length,
float defaultValue,
SvgDrawContext context)
Parses vertical length attribute and converts it to an absolute value.
|
static float[] |
parseViewBox(ISvgNodeRenderer svgRenderer)
Extract svg viewbox values.
|
static List<String> |
splitValueList(String value)
Splits a given String into a list of substrings.
|
public static List<String> splitValueList(String value)
value - the string to be split@Deprecated public static String convertFloatToString(float value)
Float.toString(float)value - to be converted float value@Deprecated public static String convertDoubleToString(double value)
Double.toString(float)value - to be converted double valuepublic static float parseAbsoluteLength(AbstractSvgNodeRenderer svgNodeRenderer, String length, float percentBaseValue, float defaultValue, SvgDrawContext context)
svgNodeRenderer - renderer for which length should be parsedlength - String for parsingpercentBaseValue - the value on which percent length is based ondefaultValue - default value if length is not recognizedcontext - current SvgDrawContextpublic static float parseAbsoluteVerticalLength(AbstractSvgNodeRenderer svgNodeRenderer, String length, float defaultValue, SvgDrawContext context)
svgNodeRenderer - renderer for which length should be parsedlength - String for parsingdefaultValue - default value if length is not recognizedcontext - current SvgDrawContextpublic static float parseAbsoluteHorizontalLength(AbstractSvgNodeRenderer svgNodeRenderer, String length, float defaultValue, SvgDrawContext context)
svgNodeRenderer - renderer for which length should be parsedlength - String for parsingdefaultValue - default value if length is not recognizedcontext - current SvgDrawContextpublic static float[] parseViewBox(ISvgNodeRenderer svgRenderer)
svgRenderer - the ISvgNodeRenderer instance that contains
the renderer treepublic static com.itextpdf.kernel.geom.Rectangle extractWidthAndHeight(ISvgNodeRenderer svgRenderer, float em, SvgDrawContext context)
SvgDrawContext.getCustomViewport()
if either one is not present. If SvgDrawContext.getCustomViewport() isn't specified, than respective
viewbox values or browser default (if viewbox is missing) will be used.svgRenderer - the ISvgNodeRenderer instance that contains the renderer treeem - em value in ptcontext - the svg draw contextCopyright © 1998–2025 Apryse Group NV. All rights reserved.