Replies: 1   Views: 1641
Placeholders with html - need to keep basic word styling.
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  · 11-02-2020 - 13:22


That feature, keep existing styles when replacing a placeholder by HTML, will be available in phpdocx 10 as HTML Extended option. Please note that HTML Extended is only available in Premium licenses.

As phpdocx 10 hasn't been released yet, it only can be used by users with a Premium license and LUS active; if you upgrade your license and send an e-mail to contact[at], the dev team will send you the new classes and samples about how to use it.

Using the current version of replaceVariableByHTML there's no other option than set the font-family and font-size to be used. Using getWordStyles, available since the release of phpdocx 9 in Advanced and Premium licenses,you can get styles from an existing content so they can be added dynamically to the HTML to be added.