Forum


Replies: 4   Views: 1204
Addtext end paragraph with carrige return and i want with break paragraph
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 JacquesMarques  · 18-05-2021 - 16:47

Hello,

You are right, but I found out that my problem is with the CreateDocxFromTemplate in version 6.2 the code below works perfectly well its add, but in version 8.2 its add a soft line after addText 'Question 1)' text:

 

$docx = new CreateDocxFromTemplate('Doc1.docx');

$content = new WordFragment($docx, 'document');
$content->addText('Question 1) ', array('fontSize' => 12, 'bold' => true));

$referenceNode = array(
   'type' => 'paragraph',
   'occurrence' => 1,
);

$docx->insertWordFragment($content, $referenceNode, 'inlineBefore', false);
$docx->createDocx('ResultDoc.docx' );

Can you help me with this?

Reguards,