Replies: 1   Views: 387
Set normal margins
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 phosira  · 03-11-2022 - 10:22

When CreateDocx it sets custom Margins.

how can i set docx normal Margins?

Posted by admin  · 03-11-2022 - 10:45


When a new DOCX is created using CreateDocx, default page size and margins are added. The default paper size is set in config/phpdocxconfig.ini :

; default paper size
paper_size = "A4"

You can customize the default paper size changing this value. Using the modifyPageLayout method the paper size, the margins and other settings can be changed. When adding new sections with addSection, the paper size and margins can also be set.

Or you can use a custom DOCX template with CreateDocxFromTemplate.