Hello,
We have checked your DOCX and script. Please note the following:
- If we run your code, the new footers appear in the chosen sections (the last section as default using addFooterSection). MS Word displays them correctly.
- The last section from your template (not the new section added with addSection, but the last existing section in your "agreement.docx" file), uses a continuous section type. First page target in headers and footers in MS Word works with Next Page Breaks, not continuous type. If instead of a continuous section type, you set a Next Page type, the first page footer (and other footer targets) of the section appears as needed. Using a template, you need to set the correct section styles/types (layouts) in the template to generate the needed output. If you want to change these styles on the fly, for example changing a section from continuous to next, you can use DOCXCustomizer (https://www.phpdocx.com/api-documentation/docxcustomizer/customize-docx-Word-documents-PHP).
We have checked that everything is working correctly and following the MS Word requirements to get all possible outputs.
Regards