Hello,
importHeadersAndFooters, addHeader and addFooter overwrite existing headers/footers.
If you need to add/change/remove contents in existing headers/footers you can use the following approaches:
- Use template methods available in all licenses (https://www.phpdocx.com/documentation/practical/adding-content-to-a-template).
- Use DOCXPath available in Advanced and Premium licenses: https://www.phpdocx.com/documentation/introduction/docxpath. Headers and footers in DOCXPath are supported since phpdocx 9.5 (https://www.phpdocx.com/news/post/phpdocx-v9-5-release-notes/219).
Regards.