# PdfGraphics class Null safety

Pdf drawing operations

## Constructors

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

## Properties

defaultFont PdfFont?
Default font if none selected
hashCode int
The hash code for this object. [...]
runtimeType Type
A representation of the runtime type of the object.

## Methods

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, [ w, 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, ) → void
Draws a Rectangle
drawRRect(double x, double y, double w, double h, double rv, double rh) → void
Draws a Rounded Rectangle
drawShape() → void
Draw an SVG path
drawString(PdfFont font, double size, String s, double x, double y, {double charSpace = 0, double wordSpace = 0, double scale = 1, PdfTextRenderingMode mode = PdfTextRenderingMode.fill, double rise = 0}) → 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()
Get the transformation Matrix
lineTo(double x, ) → void
This adds a line segment to the current path
markContentBegin(PdfName tag) → void
markContentEnd() → void
moveTo(double x, ) → void
This moves the current drawing point.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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 graphc context
setColor( color) → void
Sets the color for drawing
setFillColor( color) → void
Sets the fill color for drawing
setFillPattern(PdfPattern pattern) → void
Sets the fill pattern for drawing
setFont(PdfFont font, double size, { charSpace, wordSpace, scale, mode = PdfTextRenderingMode.fill, 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( color) → void
Sets the stroke color for drawing
setStrokePattern(PdfPattern pattern) → void
Sets the stroke pattern for drawing
setTransform() → void
Set the transformation Matrix
strokePath({bool close = false}) → void
Draw the contour of the previously defined shape
toString()
A string representation of this object. [...]
inherited

## Operators

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

## Static Methods

shapeBoundingBox()
Calculates the bounding box of an SVG path