Forum


Replies: 1   Views: 276
Adding footers in specific sections
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 27-02-2025 - 11:00

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