Forum


Replies: 1   Views: 157
Add a word fragment at the bottom of a page.
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 fur99qan  · 31-01-2024 - 06:06

  • Is there any way to add a wordfragment so that it always appears in a specific location on a page, such as a few inches above the bottom?
  • Is there any way to add a footer that only appears on the last page of the document?

Posted by admin  · 31-01-2024 - 08:19

Hello,

What version and license of phpdocx are you using?

Please note that DOCX documents don't work internally with pages but with sections. Sections and contents generate pages. A DOCX is 'painted' dynamically, for this reason the output of a DOCX my change depending on the DOCX reader.

MS Word doesn't include a last page target for headers or footers, only first, default and even targets are available. Using an Advanced or a Premium licenses, you can generate a new section at the end of the document with addSection (https://www.phpdocx.com/api-documentation/layout-and-general/add-section-Word-document-with-PHP) and insert a new footer into this new section with addFooterSection (https://www.phpdocx.com/api-documentation/layout-and-general/insert-footers-section-Word-document-with-PHP).

Regards.