startNumber property
int
get
startNumber
Gets or sets start number for ordered list. Default value is 1.
//Create a new PDF document.
PdfDocument document = PdfDocument();
//Create a new ordered list.
PdfOrderedList(
items: PdfListItemCollection(['Essential tools', 'Essential grid']),
font: PdfStandardFont(PdfFontFamily.helvetica, 16,
style: PdfFontStyle.italic),
marker: PdfOrderedMarker(style: PdfNumberStyle.numeric)
//Set the start number.
..startNumber = 2)
..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
int get startNumber => _helper._startNumber;
set
startNumber
(int value)
Implementation
set startNumber(int value) {
if (value <= 0) {
throw ArgumentError('Start number should be greater than 0');
}
_helper._startNumber = value;
}