Replies: 2   Views: 3176
Embedded html : how to inherit the font size and family of a template document?
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  · 01-11-2017 - 13:22

phpdocx 10 Premium licenses include the new option stylesReplacementType in HTML Extended, to keep existing placehoder pPr and rPr styles when being replaced by HTML.



There's no method do it automatically. The easiest solution would be extracting the default information from the word/styles.xml file (w:docDefaults tag) and apply it to the HTML as a body (or another root tag) CSS.

The beta version of the Indexer class allows extracting that information (default font size, font family, lang and spacing); if you upgrade to the latest version of phpdocx we'll send you this new file and a script to illustrate how to that.