Forum


Replies: 4   Views: 4496
Embedhtml(): how to style bold text when strictwordstyles = true
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 shroom  · 18-12-2015 - 15:35

>>We recommend you to read in detail the documentation available on this page: http://www.phpdocx.com/documentation/introduction/html-to-word-PHP.

Believe me, I have read that page many times.

>>And a paragraph custom style can't be applied to a chunk of text

I am not trying to apply a paragraph style, I am trying to apply a character style to a <span>.  This guy had the same problem.  Was it ever solved?

http://www.phpdocx.com/en/forum/default/topic/536

The documentation states: "One may associate different Word styles to HTML classes, ids or tags."  I have tried associating an imported style to a classed <span>, it does not work.  I have tried associating an imported style to a tag, it does not work except for certain tags (<h1>, <h2>, etc).  I know the imported style is valid because when I apply it to the text after the docx is created, it works.  

I tried setting strictWordStyles = false, and while inline styles are then processed, some of my custom styles are not fully applied.  

It just seems that with strictWordStyles=true, there should be SOME way to apply a custom style to a classed <span>.  According to the documentation it should work, but I have not had any success.  Is it possible for you to create a simple example demonstrating that it does work?

Thanks.