Replies: 1   Views: 1893
Replacevariablebyhtml inconsistent formatting in template
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 cem  · 05-04-2016 - 19:30

I have the Enterprise version 5.1 and I'm using a Word template via CreateDocxFromTemplate.  I have a couple private functions in the phpdocx file and one of the functions seems to keep the font type and size.   The other does not and seems to default to Word "normal" default.  I've tried creating Word Styles, I've tried embedding fonts, nothing is consistent with pretty much any font and formatting settings for the replace variable method.  I've read over the forums and seen multiple instances of people with issues formatting/font problems.  The few suggestions like styles have not helped.   Is there some other setting somewhere that forces the formatting to work properly?   defaultfont() doesn't work either I guess because it's a template.   I'm completely new to phpdocx and the documentation has good samples, but no meat that I can find on actually troubleshooting anything.  Thanks for any help provided!

Posted by admin  · 06-04-2016 - 07:10


Please write to contact[at] and we'll help you with your issues. Please send to this email address a small script that illustrates your issues (without doing external connections such as databases or webservices) and the DOCX output you get after running the script.

Also please check that Tidy is installed and running on your server before using any HTML method (embedHTML and replaceVariableByHTML).