We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to set the width of html?

When I convert doc to html when using aspose.words,could you tell me how to change the style of the html?for example: Change the width of html and the margin of the html. Thank you very much!

Hi there,


Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does.

It would be great if you please share your input Word document and expected output HTML here for our reference. We will then provide you more information about your query.

Please note that formatting is applied on a few different levels. For example, let’s consider formatting of simple text. Text in documents is represented by Run element and a Run can only be a child of a Paragraph. You can apply formatting

1) to Run nodes by using Character Styles e.g. a Glyph Style.
2) to the parent of those Run nodes i.e. a Paragraph node (possibly via paragraph Styles).
3) you can also apply direct formatting to Run nodes by using Run attributes (Font). In this case the Run will inherit formatting of Paragraph Style, a Glyph Style and then direct formatting.

Please refer to the following article:
Specifying Formatting