docx
docx copied to clipboard
Ignore Pages for TOTAL_PAGES Counter?
With the following snippet I add a page counter to the footer area of my document. However, I only start counting on the third page of my file. Currently, with this snippet I end up with e.g. "4 / 6" at the last page since PageNumber.TOTAL_PAGES obviously starts counting at the very first page.
footers: {
default: new Footer({
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
children: [
new TextRun({
children: [PageNumber.CURRENT, "/", PageNumber.TOTAL_PAGES],
color: oCompanyImage.color,
font: oUser.CompanyRef.CompanyFont,
}),
],
}),
],
}),
},
How can I "ignore" the first two pages for my footer, so they are not added up to my TOTAL_PAGES?
Push :)
Push