Forum


Replies: 2   Views: 3871
Replacetemplatevariablebyhtml - drop style
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 benoit.quentin-tr@sncf.fr  · 28-05-2014 - 13:37

Hello,



When I use :



$PHPDocx->replaceTemplateVariableByHTML($html, 'inline', $valeur, array('strictWordStyles' => true, 'isFile' => false, 'parseDivsAsPs' => true));



It drop all <p> style : text-align, padding-left, margin-left ...



I must use strictWordStyles, because I need to respect the template’s font style and size.



How can I do align text differently?


Posted by jorgelj  · 29-05-2014 - 09:16

Hello,



You can set the text align in the template or in the HTML. If you want to set a new style you can use the option:



'wordStyles' (array) associates a particular class, id or HTML tag to a Word style



You just need to set the word style a associate it to a class.



Regards.