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.
When using the embedHTML function, is there a way to override the default styles?
For example: at the moment I have the following (where the article content is Markdown):
http://pastebin.com/uDjM7wwV
Is there a better way to do this?
Hello,
The embedHtml method has these options to preserve or ignore the styles:
* 'strictWordStyles' (boolean) if true ignores all CSS styles and uses the styles set via the wordStyles option (see next)
* 'wordStyles' (array) associates a particular class, id or HTML tag to a Word style
Regards.
Thanks! I've been trying this but I can't seem to make it work. I have the following code:
http://pastebin.com/SDhKiDjK
However, where I'm setting the text as size 10, Trebuchet MS, it's coming out in the Word document as size 12, Times.
Have I misunderstood how this functionality works?
Many thanks
Hello,
You need to set the full tag in the wordStyles, not only its name. For example <p> instead of just p
The tutorial on:
http://www.phpdocx.com/introduction/tutorial
has an example of this.
Regards.