Forum


Replies: 9   Views: 331
How to reduce space between one line break
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 fairshareitservices  · 30-07-2024 - 10:45

Okay. When I use \n with instead of break it works with the replaceVariableByText() method. For whne there is a bold tag in the sentence we use below code
 

$docx = new CreateDocx();

    $wf = new WordFragment($docx);
 

 $text[] = array(

                    'text' => $partialInputExploded[$i],

                    'bold' => true,

                    'fontSize' => 5.5,

                    'font' => 'Arial',

                );
$wf->addText($text, array('font' => 'Arial', 'fontSize' => 7)); and then use replaceVariableByWordFragment(array($placeHolderName => $fomattedWordFragment), array('type' => 'inline')); So for this we \n add the sentence to new line but \n remains same in the generated output