Issues with Wrap Text for Image

Hi,

we used aspose.word to convert word documents into html, some of cases we have are images that have wrap text in (square, tight, through, top&bottom).

We have two problems:

Problem 1: After converting such as word file into html, the text wrapping isn’t corresponding to the word file when viewing it in HTML.

after converting the following word file:
upload_test_wrapping.docx (34.8 KB)

the html output is:
upload_test_wrapping_from_doc_to_html.zip (20.0 KB)

before:

After:

Problem 2: When converting the same HTML into Word, all the text wrapping defaulted to (square) instead of returning to its original wrapping. The format is completely different from the original word document.
upload_test_wrapping_from_html_to_doc.docx (26.9 KB)

@ptcdwu Thank you for reporting the problems to us.

I am afraid this is an expected behavior. HTML and MS Word documents models are very different and it is difficult and sometimes impossible to get 100% fidelity when convert one to another. In this case Aspose.Words behaves just like MS Word does. If you convert your document to HTML using MS Word the output will look the same as Aspose.Words output.
If you need to retain the visual appearance of your input document in HTML, you can consider converting it to HtmlFixed:

Document doc = new Document(@"C:\Temp\in.docx");
doc.Save(@"C:\Temp\out.html", SaveFormat.HtmlFixed);

In this case the document is rendered and look just like in MS Word.

The reason of this problem is the same as I have already mentioned. It is impossible to guaranty 100% fidelity after MS Word → HTML → MS Word roundtrip. Please see the following articles to learn about features supported upon importing and exporting HTML documents:
https://docs.aspose.com/words/net/load-in-the-html-html-xhtml-mhtml-format/
https://docs.aspose.com/words/net/save-in-html-xhtml-mhtml-formats/