Package com.itextpdf.svg.utils
Class DrawUtils
java.lang.Object
com.itextpdf.svg.utils.DrawUtils
Utility class for drowing shapes on
PdfCanvas
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Draw an arc on the passed canvas, enclosed by the rectangle for which two opposite corners are specified.static void
arc
(double x1, double y1, double x2, double y2, double startAng, double extent, PdfCanvas cv, AffineTransform transform) Draw an arc on the passed canvas with provided transform, enclosed by the rectangle for which two opposite corners are specified.static void
doStrokeOrFillForClosedFigure
(String fillRuleRawValue, PdfCanvas currentCanvas, boolean doStroke) Perform stroke or fill operation for closed figure (e.g.
-
Method Details
-
arc
public static void arc(double x1, double y1, double x2, double y2, double startAng, double extent, PdfCanvas cv) Draw an arc on the passed canvas, enclosed by the rectangle for which two opposite corners are specified. The arc starts at the passed starting angle and extends to the starting angle + extent- Parameters:
-
x1
- corner-coordinate of the enclosing rectangle, first corner -
y1
- corner-coordinate of the enclosing rectangle, first corner -
x2
- corner-coordinate of the enclosing rectangle, second corner -
y2
- corner-coordinate of the enclosing rectangle, second corner -
startAng
- starting angle in degrees -
extent
- extent of the arc -
cv
- canvas to paint on
-
arc
public static void arc(double x1, double y1, double x2, double y2, double startAng, double extent, PdfCanvas cv, AffineTransform transform) Draw an arc on the passed canvas with provided transform, enclosed by the rectangle for which two opposite corners are specified. The arc starts at the passed starting angle and extends to the starting angle + extent- Parameters:
-
x1
- corner-coordinate of the enclosing rectangle, first corner -
y1
- corner-coordinate of the enclosing rectangle, first corner -
x2
- corner-coordinate of the enclosing rectangle, second corner -
y2
- corner-coordinate of the enclosing rectangle, second corner -
startAng
- starting angle in degrees -
extent
- extent of the arc -
cv
- canvas to paint on -
transform
-AffineTransform
to apply before drawing, ornull
in case transform shouldn't be applied
-
doStrokeOrFillForClosedFigure
public static void doStrokeOrFillForClosedFigure(String fillRuleRawValue, PdfCanvas currentCanvas, boolean doStroke) Perform stroke or fill operation for closed figure (e.g. Ellipse, Polygon, Circle).- Parameters:
-
fillRuleRawValue
- fill rule (e.g. evenodd, nonzero) -
currentCanvas
- canvas to draw on -
doStroke
- if true, stroke operation will be performed, fill otherwise
-