PdfPen class

A class defining settings for drawing operations, that determines the color, width, and style of the drawing elements.

//Create a new PDF document.
PdfDocument doc = PdfDocument()
  ..pages.add().graphics.drawRectangle(
      //Create a new PDF pen instance.
      pen: PdfPen(PdfColor(255, 0, 0)),
      bounds: Rect.fromLTWH(0, 0, 200, 100));
//Save the document.
List<int> bytes = doc.save();
//Close the document.
doc.dispose();

Constructors

PdfPen(PdfColor pdfColor, {double width = 1.0, PdfDashStyle dashStyle = PdfDashStyle.solid, PdfLineCap lineCap = PdfLineCap.flat, PdfLineJoin lineJoin = PdfLineJoin.miter})
Initializes a new instance of the PdfPen class.
PdfPen.fromBrush(PdfBrush brush, {double width = 1.0, PdfDashStyle dashStyle = PdfDashStyle.solid, PdfLineCap lineCap = PdfLineCap.flat, PdfLineJoin lineJoin = PdfLineJoin.miter})
Initializes a new instance of the PdfPen with PdfBrush.

Properties

brush PdfBrush?
Gets or sets the brush, which specifies the pen behavior.
getter/setter pair
color PdfColor
Gets or sets the color of the pen.
getter/setter pair
dashOffset double
Gets or sets the dash offset of the pen.
getter/setter pair
dashPattern List<double>
Gets or sets the dash pattern of the pen.
getter/setter pair
dashStyle PdfDashStyle
Gets or sets the dash style of the pen.
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
lineCap PdfLineCap
Gets or sets the line cap of the pen.
getter/setter pair
lineJoin PdfLineJoin
Gets or sets the line join style of the pen.
getter/setter pair
miterLimit double
Gets or sets the miter limit.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width double
Gets or sets the width of the pen.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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