Sub-group Page Numbering Support in Docxtemplater for Invoice & Packing List
-
Hi Team,
We are generating documents using Docxtemplater and have a requirement for separate page numbering groups within the same generated DOCX.
Requirement
Our generated document contains multiple sections:
Invoice Pages
Packing List PagesWe need independent page numbering for each section/group.
Expected Output
Invoice Section
Invoice Page 1 → 1 of 3
Invoice Page 2 → 2 of 3
Invoice Page 3 → 3 of 3
Packing List Section
Packing List Page 1 → 1 of 2
Packing List Page 2 → 2 of 2So the page numbering should restart and calculate totals separately for each document group/section instead of the whole DOCX.
Current Challenge
Using normal Word fields like:
PAGE
NUMPAGESis calculating based on the entire document, not per subgroup/section.
Questions
Is there any supported approach in Docxtemplater to achieve subgroup-wise page numbering?
Can this be done using Word section breaks with separate numbering?
Any recommended plugins/modules or template structure for this use case?
Has anyone implemented independent page counts for multiple logical documents merged into one DOCX?
Tech Stack
Docxtemplater
Node.js
DOCX template generationAny guidance or working examples would help. Thanks!