Forum


Replies: 5   Views: 6065
"spacing_top" and "spacing_bottom" options for addtext function
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 nicolas  · 29-04-2011 - 11:09

Hi,

It will be very usefull to control the spacing (top and bottom) for a paragraph.
By default, all text generated (via addText function) has a spacing_top=0pt and spacing_bottom=10pt. At the moment, we can not change the values with PHPDOCX.

Regards,

Posted by Icemann3000  · 11-04-2013 - 12:12

Are there any news regarding this Point?

On the Function "addHeader" i can add these options, but the "addHeader" calls internally "addText", and at V2.3 "addText" doesn´t support "spacing" Parameters.

Need it really urgent.

Cheers
Michael

Posted by raoulhira  · 11-04-2013 - 12:12

[quote][b]Quote from nicolas on April 29, 2011, 11:09[/b]
Hi,

It will be very usefull to control the spacing (top and bottom) for a paragraph.
By default, all text generated (via addText function) has a spacing_top=0pt and spacing_bottom=10pt. At the moment, we can not change the values with PHPDOCX.

Regards,[/quote]

This is required for basic formatting! if you implement this it would be extremely helpful!

Posted by nicolas  · 11-04-2013 - 12:12

Did you try this : http://www.phpdocx.com/archives/1888 ?
It can be a workarround if your text is on several lines.
For your information I am still waiting "spacing_top" and "spacing_bottom" options for addText function...

Posted by admin-phpdocx  · 12-07-2013 - 13:31

You may include in the $paragraphOptions array of the addText method the spacingTop and spacingBottom parameters.



Beware that they are given in twentieths of a point so if you want a top spacing of 20pt you have to set spacingTop to 400