Free Support Forum -

HTML to DOC/DOCX - Conversion problem

When converting from HTML to DOC/DOCX, few styles such as height, width, text-align etc., (inside the style attribute) does not take effect. But when they are move as individual attributes of the node, they come into effect.

Example :

does not set the size of the image in the converted DOC/DOCX
But does.

doesn’t work

Can you give me a list of styles that are not-supported or supported inside the ‘style’ attribute?

Is this an issue with the Aspose converter?
Are there any work-arounds?


Hello!<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your inquiry.

Here are some restrictions in the current implementation of HTML import. On the div and img nodes most of things are done with separate attributes. And style=”xxx” is good for p and span.

We have no full list of supported formatting in style attribute but basically you can see this one (right from the code):

// paragraph attributes (p tag)






























// character attributes (span tag)
















Also you can make reverse conversion from DOC to HTML using Aspose.Words and see what we output. Many things (but not all) are aware of roundtrip. It’s a good idea to perform tests on documents with rich formatting.

Some restrictions are also described in this table where you can find elements supported in HTML import:

As a workaround we can suggest replacing what is not recognized with what is recognized. This can be done either manually or with regular expressions. Please let us know if you have further questions or need more help.