Forum


Replies: 3   Views: 1120
Top border missing from image
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  · 02-11-2021 - 06:58

Hello,

The code you are running is setting spacing styles to 0:

'spacingTop' => 0,
'spacingBottom' => 0,
'spacingLeft' => 0,
'spacingRight' => 0,

and the paragraph overlaps the top border. When you open the document with MS Word and do minor change to the image, MS Word changes spacing values (it is removing 0 top and bottom spacings and adding other values).

phpdocx follows the OOXML standard and a 0 value applied to image spacings is valid too (and useful for specific cases). If you want to display the borders in all cases, without being overlapped by other contents, we recommend you apply a non 0 spacing value, for example:

'spacingTop' => 2,
'spacingBottom' => 2,
'spacingLeft' => 0,
'spacingRight' => 0,

Regards.