Snippets
- Learn phpdocx in 5 minutes
- Tutorial
- API quick guide
- HTML to Word
- HTML Extended
- Conversion plugin
- Word to HTML
- DOCXPath
- Bulk processing
- DOCXCustomizer
- Digital signature
- Cryptophpdocx
- Right to left languages
- phpdocx CLI command
- Tracking
- Artificial Intelligence
- Blockchain for documents
- JavaScript API
- Compiled mode
Adding contents at the bottom of the last page
MS Word doesn't support adding content only in the footer of the last page. Only default, first, and even targets are available in headers and footers.
To add a content at the bottom of the last page, a new section with a new footer can be generated using addSection and addFooterSection:
This code generates a new section with a new page where the new footer is added, so it may not be adequate.
Instead of generating a new section with a new footer, a floating table can be used to add content at the bottom of the last page in existing sections:
Supported tblpYSpec values: center, inside, bottom, outside, inline and top.
Supported vertAnchor values: margin, page and text.
Table styles can be applied to hide borders, set margins...
DOCXCustomizer, available in Premium licenses, is required to run this code.
These snippets work with DOCX documents created from scratch and using DOCX templates.
DOCXPath allows inserting floating tables in specific sections.
LibreOffice supports floating tables since LibreOffice 7.6.