Forum


Replies: 3   Views: 103
Remove left and right margins in header / footer

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.