Forum


Replies: 5   Views: 455
Importcontents only for body, not for header/footer
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  · 10-11-2023 - 06:10

Hello,

Although using replaceVariableByExternalFile is a good approach in some cases, please note that this method uses altChunk tags that are not supported by some DOCX readers. MS Word supports it, but other such as Google Docs or old LibreOffice versions don't. And this method doesn't allow to customize the imported contents.

We recommend you use importContents, mergeDocx (using in-memory DOCX documents if you don't want to generate extra external files) or overwrite the headers/footers using importHeadersAndFooters.

Regards.