Forum


Replies: 4   Views: 3470
Wordfragmant -> createparagraphstyle() possible that not work?
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 Sven May  · 06-05-2015 - 09:19

Hello! I use WordFragment class like this: $wf = new WordFragment($docx); Insert a HTML code with embedHtml method: $wf->embedHTML($htmlCode); I want to set some Word stlyes therefore I use this way: $style = array('color'=>'999999','font'=>'Arial Black'); $wf->createParagraphStyle('myStyle', $style); $wf->embedHTML('
'.$htmlCode.'
', array('strictWordStyles'=>true, 'wordStyles'=>array('
'=>'myStyle'))); Finally I got the following error message: Fatal error: Call to a member function saveXML() on a non-object in ......Classes/Phpdocx/Create/CreateDocx.inc on line 3484 If I try to use createParagraphStyle with $docx variable it's work fine but iformatting does not applying... It could be that WordFragment class not able to use this method? If yes...how can I add own word style or any word styla to my htmlCode content? Thanks!