generate method
Implementation
void generate(Document document, {bool insert = true, int? index}) {
if (index != null) {
if (insert) {
_pdfPage =
PdfPage(document.document, pageFormat: pageFormat, index: index);
} else {
_pdfPage = document.document.page(index);
}
} else {
_pdfPage = PdfPage(document.document, pageFormat: pageFormat);
}
}