Hi Alexey,
It’s weird that you can’t reproduce it. I’m trying to think of differences in the way your test app is implemented and how I use Aspose this side that could influence this. For one, I don’t have the HTML in a file, only a string. I create MemoryStream and a StreamWriter and then read the html into the memory stream. Then for the conversion, I create an Aspose document from the MemoryStream, and save it to another MemoryStream as SaveFormat.Docx. Here is the code:
1 using (MemoryStream htmlStream = new MemoryStream())
2 using (StreamWriter writer = new StreamWriter(htmlStream))
3 {
4 writer.Write(html);
5 writer.Flush();
6 doc = new Aspose.Words.Document(htmlStream, String.Empty, Aspose.Words.LoadFormat.Html, String.Empty);
7
8 using (MemoryStream mlStream = new MemoryStream())
9 using (StreamReader sr = new StreamReader(mlStream))
10 {
11 doc.Save(mlStream, Aspose.Words.SaveFormat.Docx);
12 mlStream.Position = 0;
13
14 pValue = ExtractHtmlConvertedWordML(mlStream);
15 }
16 }
I have already provided the output docx in the initial attachment. I’ll include it again (result.docx). But I have another issue with converting HTML to WordML.
When I have a table in the html that is aligned to center or right by way of a paragraph, the alignment in the resulting docx is gone. The attachment show the issue.
Charl Marais