pages property

Gets the collection of pages in this section.

//Create a new PDF documentation
PdfDocument document = PdfDocument();
//Create a new PDF section
PdfSection section = document.sections!.add();
//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

PdfPageCollection get pages {
  _pageCollection ??= PdfPageCollectionHelper.load(_helper.pdfDocument, this);
  return _pageCollection!;
}