PdfTemplate class
Represents PDF Template object.
//Create a new PDF template and draw graphical content like text, images, and more.
PdfDocument document = PdfDocument()
..pages.add().graphics.drawPdfTemplate(
PdfTemplate(100, 50)
..graphics!.drawString(
'Hello World!', PdfStandardFont(PdfFontFamily.helvetica, 14),
brush: PdfBrushes.black, bounds: Rect.fromLTWH(5, 5, 0, 0)),
Offset(0, 0));
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();
Constructors
- PdfTemplate(double width, double height)
- Initializes a new instance of the PdfTemplate class.
Properties
- graphics → PdfGraphics?
-
Gets graphics context of the template.
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
- size → Size
-
Gets the size of the template.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
[double? width, double? height]) → void - Resets an instance.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited