Forum


Replies: 6   Views: 285
Widowcontrol in combination with html inserted text
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 Dale.Cooper  · 19-10-2023 - 13:09

Hi everyone,

I am just new to phpdocx but I really love it. In my current usecase, I am inserting a lot of HTML to a template with these functions:

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

$docx->embedHTML($html_input);

Now I want to enable the widowcontrol for everything in the word document. I have set up this an combined it with embedHTML

$paragraphOptions = array(
    'widowControl' => true,
);

$docx->embedHTML($html_input, $paragraphOptions);

But it's not working. Is it possible, that the paragraphOptions only work for addText? In my usecase, I would like to stay with my preformatted html coming from another system and just hand it over as one junk rather splitting it up and rebuilding the structure in different paragraphs. 

Am I doing/misunderstanding anything wrong here? Is the widow control achievable with embedHTML or any other way to deal with this?

Thanks in advance!