Forum


Replies: 6   Views: 2286
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 cmoller  · 26-03-2019 - 02:49

I am trying to figure out how to embed HTML text and display with a double underline. I have tried embedHTML with CSS styles to format with a double underline but it only displays the text with a single underline.

$docx = new CreateDocx();
$docx->embedHtml('<html><body><div id="content"><p>test <abbr style="text-decoration: underline; text-decoration-style: double;">abbr</abbr></p></div></body></html>');
$docx->createDocxAndDownload('result.docx');  
 

So I am trying now to use my own Double Underline word style. I have defined a style in the document word.docx for double underline and I can apply it as follows.

$docx = new CreateDocx();
$docx->importStyles('word.docx', 'merge', array('Double Underline'));
$docx->addText('This is some sample character test', array('rStyle' => 'DoubleUnderline'));

But when I try use the same word.docx template Double Underline style with embedHTML it doesn't work.

$docx = new CreateDocx();
$docx->importStyles('word.docx', 'merge', array('Double Underline'));
$wordStyles = array('.dblunderline' => 'DoubleUnderline');
$docx->embedHTML('<p class="dblunderline">my test</p>', array('strictWordStyles' => true, 'wordStyles' => $wordStyles));
$docx->createDocxAndDownload('result.docx');  

What am I missing?

Charlotte