Forum


Replies: 1   Views: 1068
Html font colours
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 royh  · 16-07-2021 - 14:53

Good day,

I am using replaceVariableByHTML to display text but can't seem to display the text in the HTML colors defined.

Here is the HTML and text:

<ol>
<li><span style="color: #00ff00;">TEXT</span></li>
</ol> 
$stylesReplacementTypeIgnore = array('w:sz', 'w:szCs', 'w:rFonts', 'w:lvlJc', 'w:color', 'w:rPr');
$docx->replaceVariableByHTML('TAG', 'block', $html, array('stylesReplacementType' => 'mixPlaceholderStyles', 'stylesReplacementTypeIgnore' => $stylesReplacementTypeIgnore, 'useHTMLExtended' => true));

I can't seem to figure out what replacements I need to add to see the TEXT in #00ff00.

Thanks.