sections property

Gets the collection of the sections in the document.

//Create a PDF document instance.
PdfDocument document = PdfDocument();
//Add a new section.
PdfSection section = document.sections!.add();
//Create page for the newly added section and draw text.
section.pages.add().graphics.drawString(
    'Hello World!', PdfStandardFont(PdfFontFamily.helvetica, 12),
     brush: PdfBrushes.black, bounds: Rect.fromLTWH(0, 0, 0, 0));
//Save and dispose document.
List<int> bytes = await document.save();
document.dispose();

Implementation

PdfSectionCollection? get sections => _sections;