Forum


Replies: 6   Views: 2445
Display text with double underline
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  · 27-03-2019 - 07:38

Hello,

Thanks for attaching the file. The problem is that you are trying to apply a character style to a paragraph tag. Although addText allows it, the embedHTML can't apply it. You need to use a paragraph style, for example using a custom paragraph style (DocHeading4) from your document:

$docx->importStyles('word.docx', 'merge', array('DocHeading4'));

$wordStyles = array('.dblunderline' => 'DocHeading4');

$docx->embedHTML('<p class="dblunderline">my test</p>', array('strictWordStyles' => true, 'wordStyles' => $wordStyles));
$docx->createDocx('result.docx'); 

Please note that you can't apply a character style using embedHTML and a Basic license. You'd need to use HTML Extended available only in Premium licenses.

Regards.