PdfOrderedList constructor
PdfOrderedList({
- PdfOrderedMarker? marker,
- PdfListItemCollection? items,
- String? text,
- PdfFont? font,
- PdfNumberStyle style = PdfNumberStyle.numeric,
- PdfStringFormat? format,
- bool markerHierarchy = false,
- double indent = 10,
- double textIndent = 5,
Initialize a new instance of the PdfOrderedList class.
//Create a new PDF document.
PdfDocument document = PdfDocument();
//Create a new ordered list.
PdfOrderedList(
text: 'PDF\nXlsIO\nDocIO\nPPT',
font: PdfStandardFont(PdfFontFamily.helvetica, 16,
style: PdfFontStyle.italic),
format: PdfStringFormat(lineSpacing: 20),
marker: PdfOrderedMarker(style: PdfNumberStyle.numeric),
style: PdfNumberStyle.numeric,
indent: 15,
textIndent: 10)
..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
PdfOrderedList(
{PdfOrderedMarker? marker,
PdfListItemCollection? items,
String? text,
PdfFont? font,
PdfNumberStyle style = PdfNumberStyle.numeric,
PdfStringFormat? format,
this.markerHierarchy = false,
double indent = 10,
double textIndent = 5})
: super() {
final PdfListHelper helper = PdfListHelper(this);
this.marker = marker ?? _createMarker(style);
stringFormat = format;
super.indent = indent;
super.textIndent = textIndent;
if (font != null) {
helper.font = font;
}
if (items != null) {
helper.items = items;
} else if (text != null) {
helper.items = PdfListHelper.createItems(text);
}
}