PdfGraphics class

Pdf drawing operations

Constructors

PdfGraphics(PdfGraphicStream _page, PdfStream _buf)
Create a new graphic canvas

Properties

altered bool
no setter
defaultFont PdfFont?
Default font if none selected
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

applyShader(PdfShading shader) → void
Apply a shader
bezierArc(double x1, double y1, double rx, double ry, double x2, double y2, {bool large = false, bool sweep = false, double phi = 0.0}) → void
Draws an elliptical arc from (x1, y1) to (x2, y2). The size and orientation of the ellipse are defined by two radii (rx, ry) The center (cx, cy) of the ellipse is calculated automatically to satisfy the constraints imposed by the other parameters. large and sweep flags contribute to the automatic calculations and help determine how the arc is drawn.
clipPath({bool evenOdd = false, bool end = true}) → void
Create a clipping surface from the previously defined shape, to prevent any further drawing outside
closePath() → void
Close the path with a line
curveTo(double x1, double y1, double x2, double y2, double x3, double y3) → void
Draw a cubic bézier curve from the current point to (x3,y3) using (x1,y1) as the control point at the beginning of the curve and (x2,y2) as the control point at the end of the curve.
drawBox(PdfRect box) → void
Draws a Rectangle
drawEllipse(double x, double y, double r1, double r2, {bool clockwise = true}) → void
Draws an ellipse
drawImage(PdfImage img, double x, double y, [double? w, double? h]) → void
Draws an image onto the page.
drawLine(double x1, double y1, double x2, double y2) → void
Draws a line between two coordinates.
drawRect(double x, double y, double w, double h) → void
Draws a Rectangle
drawRRect(double x, double y, double w, double h, double rv, double rh) → void
Draws a Rounded Rectangle
drawShape(String d) → void
Draw an SVG path
drawString(PdfFont font, double size, String s, double x, double y, {double? charSpace, double? wordSpace, double? scale, PdfTextRenderingMode mode = PdfTextRenderingMode.fill, double? rise}) → void
This draws a string.
fillAndStrokePath({bool evenOdd = false, bool close = false}) → void
Draw a surface on the previously defined shape and then draw the contour set evenOdd to false to use the nonzero winding number rule to determine the region to fill and to true to use the even-odd rule to determine the region to fill
fillPath({bool evenOdd = false}) → void
Draw a surface on the previously defined shape set evenOdd to false to use the nonzero winding number rule to determine the region to fill and to true to use the even-odd rule to determine the region to fill
getTransform() → Matrix4
Get the transformation Matrix
lineTo(double x, double y) → void
This adds a line segment to the current path
markContentBegin(PdfName tag) → void
markContentEnd() → void
moveTo(double x, double y) → void
This moves the current drawing point.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
restoreContext() → void
This releases any resources used by this Graphics object. You must use this method once finished with it.
saveContext() → void
Save the graphic context
setColor(PdfColor? color) → void
Sets the color for drawing
setFillColor(PdfColor? color) → void
Sets the fill color for drawing
setFillPattern(PdfPattern pattern) → void
Sets the fill pattern for drawing
setFont(PdfFont font, double size, {double? charSpace, double? wordSpace, double? scale, PdfTextRenderingMode mode = PdfTextRenderingMode.fill, double? rise}) → void
Set the current font and size
setGraphicState(PdfGraphicState state) → void
Set the graphic state for drawing
setLineCap(PdfLineCap cap) → void
Set line starting and ending cap type
setLineDashPattern([List<num> array = const <num>[], int phase = 0]) → void
The dash array shall be cycled through, adding up the lengths of dashes and gaps. When the accumulated length equals the value specified by the dash phase
setLineJoin(PdfLineJoin join) → void
Set line join type
setLineWidth(double width) → void
Set line width
setMiterLimit(double limit) → void
Set line joint miter limit, applies if the
setStrokeColor(PdfColor? color) → void
Sets the stroke color for drawing
setStrokePattern(PdfPattern pattern) → void
Sets the stroke pattern for drawing
setTransform(Matrix4 t) → void
Set the transformation Matrix
strokePath({bool close = false}) → void
Draw the contour of the previously defined shape
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

shapeBoundingBox(String d) PdfRect
Calculates the bounding box of an SVG path