template property

PdfSectionTemplate get template

Gets or sets the PdfSectionTemplate for the pages in the section.

//Create a new PDF documentation
PdfDocument document = PdfDocument();
//Create a new PDF section
PdfSection section = document.sections!.add();
//Sets the page settings of the section
section.pageSettings =
    PdfPageSettings(PdfPageSize.a4, PdfPageOrientation.portrait);
//Sets the template for the page in the section
section.template = PdfSectionTemplate();
//Create a new PDF page and draw the text
section.pages.add().graphics.drawString(
    'Hello World!!!', PdfStandardFont(PdfFontFamily.helvetica, 27),
    brush: PdfBrushes.darkBlue, bounds: const Rect.fromLTWH(170, 100, 0, 0));
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();

Implementation

PdfSectionTemplate get template {
  _template ??= PdfSectionTemplate();
  return _template!;
}
set template (PdfSectionTemplate value)

Implementation

set template(PdfSectionTemplate value) {
  _template = value;
}