Forum


Replies: 4   Views: 4303
Text align html to docx
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  · 24-05-2018 - 07:09

Hello,

UPDATE: phpdocx Premium licenses include the stylesReplacementType option to mix Word and HTML styles when using replaceVariableByHTML.

A block type replacement remove the container block tag and add a new one. The solution to keep the tag properties is using an inline replacement, but then you can't change container styles.

We recommend you to set the styles of the container (such as the alignment) in the template you are using and then use an inline replacement to keep the styles. Or add a CSS style to set the font family when doing a block replacement.

Changing styles on-the-fly is only available using DOCXCustomizer available in Premium licenses (https://www.phpdocx.com/documentation/introduction/docxcustomizer). Using this feature you can do inline replacements and change style tags if needed.

Regards.