Forum


Replies: 3   Views: 4513
Line spacing in add text: a line space of 1 sets 1 line per page?
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  · 20-02-2015 - 09:27

Hi, We're normalizing the measures of all methods for the next release. So the easiest choice is that you do a minor change in the library. Please open the CreateDocx.inc class and comment or remove this line (around line 5433): $options['lineSpacing'] = ceil($options['lineSpacing'] * 240); And set the lineSpacing in twips. For example to set it as 1.5: $text = 'Lorem ipsum dolor'; $paragraphOptions = array( 'bold' => true, 'font' => 'Arial', 'lineSpacing' => 480 ); $docx->addText($text, $paragraphOptions); 360 is the value 1. So you can change it to fit your needs.