docx icon indicating copy to clipboard operation
docx copied to clipboard

Ignore Pages for TOTAL_PAGES Counter?

Open schuckspecht opened this issue 10 months ago • 2 comments

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?

schuckspecht avatar May 28 '25 15:05 schuckspecht

Push :)

alexbauerde avatar Jul 04 '25 11:07 alexbauerde

Push

alexbauerde avatar Nov 13 '25 08:11 alexbauerde