Hello,
The best and easiest solution is using a Premium license, that includes HTML Extended features. For this specific case, you can do a minor change in the library:
Edit HTML2WordML.php in the classes folder, and in the method generateRPr (around line 1859), add these lines after the line-through check:
if (isset($properties['text_decoration']) && $properties['text_decoration'] == 'double-underline') {
$stringRPr .='<w:u w:val="double" />';
}
Instead of this code:
if (isset($properties['text_decoration']) && $properties['text_decoration'] == 'line-through') {
$stringRPr .='<w:strike />';
}
if (!$this->strictWordStyles) {
this is the code updated:
if (isset($properties['text_decoration']) && $properties['text_decoration'] == 'line-through') {
$stringRPr .='<w:strike />';
}
if (isset($properties['text_decoration']) && $properties['text_decoration'] == 'double-underline') {
$stringRPr .='<w:u w:val="double" />';
}
if (!$this->strictWordStyles) {
After this change, you can use the custom double-underline value to apply a double underline style in texts:
$html = '
<style>
.underline {
text-decoration: underline;
}
.dunderline {
text-decoration: double-underline;
}
</style>
';
$html .= '<p><span class="underline">Underline</span> and <span class="dunderline">double underline</span>.</p>';
$docx->embedHTML($html);
Regards.