item property

PdfListItem get item

Gets the item.

//Create a new PDF document.
PdfDocument document = PdfDocument();
//Create a new list.
PdfOrderedList(
    text: 'PDF\nXlsIO\nDocIO\nPPT',
    font: PdfStandardFont(PdfFontFamily.helvetica, 16,
        style: PdfFontStyle.italic),
    format: PdfStringFormat(lineSpacing: 20))
  //Begin item layout event.
  ..beginItemLayout = (Object sender, BeginItemLayoutArgs args) {
    args.item.text += '_Beginsave';
  }
  //End item layout event.
  ..endItemLayout = (Object sender, EndItemLayoutArgs args) {
    args.page.graphics.drawRectangle(
        brush: PdfBrushes.red,
        bounds: const Rect.fromLTWH(400, 400, 100, 100));
    PdfListItem item = args.item;
  }
  ..draw(
      page: document.pages.add(), bounds: const Rect.fromLTWH(20, 20, 0, 0));
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();

Implementation

PdfListItem get item => _item;