Forum


Replies: 5   Views: 3891
Highlight - background color issue
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 WEBNET2014  · 12-03-2015 - 15:01

Hello, I'm using the following code to highlight some text : $docx->addText( array( array( 'text' => $text, 'highlightColor' => 'yellow' ) ) ); But in the doc rendered, it changes the background color properties of the text and not the highlight one. Is it possible to provide me a fix for this problem? I'm using phpdocx 4.3 PRO Regards

Posted by admin  · 13-03-2015 - 14:37

Hello, We have run your code and when we open the DOCX with MS Word the text is highlighted by a yellow color. Please share a screenshot. Regards.

Posted by WEBNET2014  · 13-03-2015 - 15:52

In my document, the text is highlighted too. But it uses the background color option instead of the highlight option http://imagizer.imageshack.com/img901/9434/FT4cbb.png Regards

Posted by admin  · 13-03-2015 - 20:17

Thanks, we're going to check the issue. Regards.

Posted by admin  · 16-03-2015 - 09:17

Hello, Please open the file class/CreateText.inc, and replace these lines: if (!empty($args[1]['highlightColor'])) { $this->generateSHD($args[1]['highlightColor']); } (around line 310) by: if (!empty($args[1]['highlightColor'])) { $this->generateHIGHLIGHT($args[1]['highlightColor']); } and: if (!empty($texts['highlightColor'])) { $this->generateSHD($texts['highlightColor']); } (around line 410) by: if (!empty($texts['highlightColor'])) { $this->generateHIGHLIGHT($texts['highlightColor']); } Thanks for posting the issue. This minor change solves the issue. Regards.

Posted by WEBNET2014  · 17-03-2015 - 16:54

It works now Thanks