size property

Size size

Gets the size of the template.

//Create a new PDF document.
PdfDocument document = PdfDocument();
//Create a PDF Template.
PdfTemplate template = PdfTemplate(100, 50);
//Gets the PDF template size.
Size size = template.size;
//Draw a string using the graphics of the template.
template.graphics!.drawString(
    'Hello World', PdfStandardFont(PdfFontFamily.helvetica, 14),
    brush: PdfBrushes.black, bounds: Rect.fromLTWH(5, 5, 0, 0));
//Add a new page and draw the template on the page graphics of the document.
document.pages.add().graphics.drawPdfTemplate(template, Offset(0, 0));
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();

Implementation

Size get size => _size.size;