Forum


Replies: 2   Views: 945
How can i transform word to html from internal to inline 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 admin  · 20-07-2022 - 14:23

Hello,

DOCX to HTML transforms styles as CSS styles (using style tags), not as inline styles. If you need inline styles, we recommend you to use an external library or program to transform the HTML output returned by phpdocx. On https://www.phpdocx.com/documentation/cookbook/wysiwyg-editor you can read this same recommendation:

phpdocx transforms DOCX to HTML, generating non inline CSS styles by using style tags. Some WYSIWYG editors require using inline styles. In these cases, it is advisable to convert the HTML obtained with phpdocx to an HTML with inline styles. There are many tools and libraries fit for this purpose, including native PHP solutions: https://stackoverflow.com/questions/3990706/php-class-to-inline-css-styles

Regards.