Forum


Replies: 3   Views: 318
Remove left and right margins in 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  · 18-04-2025 - 18:43

Hello,

Thanks for sending the information about the license you are using.

Please note that a DOCX document doesn't have specific left and right margins for headers or footers. Left and right margins are common to the whole document.
Top and bottom margins have specific styles you can change by using marginTop, marginBottom, marginHeader, and marginFooter options available in modifyPageLayout and addSection methods.

In this case, after setting the top/header/bottom/footer margins, the easiest approach is to set a negative left indentation for the content of the header/footer to get the needed output. addTable, addText, and other phpdocx methods include options to set custom indentations.

Regards.