PdfPen constructor
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.
//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();
Implementation
PdfPen(PdfColor pdfColor,
{double width = 1.0,
PdfDashStyle dashStyle = PdfDashStyle.solid,
PdfLineCap lineCap = PdfLineCap.flat,
PdfLineJoin lineJoin = PdfLineJoin.miter}) {
_helper = PdfPenHelper(this);
_color = pdfColor;
_initialize(width, dashStyle, lineCap, lineJoin);
}