Forum


Replies: 16   Views: 4357
Header and footer not showing
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  · 19-12-2017 - 15:00

Hello,

Please check and run the included examples of adding headers (https://www.phpdocx.com/api-documentation/layout-and-general/insert-headers-Word-document-with-PHP) and footers (https://www.phpdocx.com/api-documentation/layout-and-general/insert-footers-Word-document-with-PHP). Both methods are working perfectly.

You can find the same samples in the package. Also please check that the images have the correct extension for their mime-types (for example you are not adding a JPEG using a PNG extension file).

Please note that addHeader and addFooter methods can be used when creating a DOCX from scratch. If you are using a template you need to set placeholders in the template or import the headers/footers from an existing DOCX (https://www.phpdocx.com/api-documentation/layout-and-general/import-headers-and-footers-Word-document-with-PHP). If you need to mix both (templates and created from scratch) please use the mergeDocx method (https://www.phpdocx.com/api-documentation/docxutilities/merge-Word-documents-with-PHP, https://www.phpdocx.com/documentation/cookbook/headers-and-footers-for-sections).

Regards.