Replies: 7   Views: 3702
V3.5 introduces extra padding/spacing everywhere
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 seb  · 12-09-2013 - 16:18

Hi Guys,

Congratulations on the new release - excellent set of features and some great bug fixes.


Unfortunately v3.5 (and v3.3) seem to have introduced a lot of extra padding/paragraph/line-spacing comapred to version 3.1. This is most noticeable in the footer when using a docx template for a new docx - please see the image below:



Is there any setting I can make when creating the docx to remove or reset this extra padding/spacing? Here is the basic template I create my documents from:


Thank you very much for your help!


Posted by jorgelj  · 12-09-2013 - 18:10


Could you attach the final document?


Posted by seb  · 17-09-2013 - 17:32

Yes of course, I'd be happy to. I've attached the same document produced in PHPDOCX Pro 3.1 and 3.5 using exactly the same code. It seems like the paragraph spacing is larger by default in v3.5, and this can most clearly be seen in the footer around the page number.

v3.1 Normal padding:

v3.5 Extra padding:

Is there a setting/parameter I'm missing?

Many thanks for your help guys.


Posted by admin-phpdocx  · 17-09-2013 - 18:04

The defaults have changed but you can control all spacing and line heights with the corersponding options of the addText method (or embedHTML method via CSS).

Could you send us the code so we see how you generated the footer and do some testing?

Posted by seb  · 18-09-2013 - 14:55

Hello again,

Please download my basic example here:

If you generate the DOCX with v3.1 and v3.5, you'll see the line/paragraph spacing is different and this is affecting the footer as well as the document's body text. In v3.1 all the text fits on one page. In v3.5 the text spills over on to two pages, and the footer appears stretched vertically.

Thank you so much guys for looking in to this. If there is a configuration change I can make to force v3.5 to look the same as v3.1 that would be great.

Kind Regards,


Posted by seb  · 25-09-2013 - 12:37

There are some base template files in phpdocx/templates which you need to remove all paragraph spacing from. Backup your existing files at:


  • phpdocxBaseTemplate.docx

  • phpdocxBaseTemplateNumberedHeadings.docx


Then save them with no paragraph spacing. All problems sorted for me after this.