Mhtml issue

Hello
Kindly use this code against my sample mhtml to save it as html and compare the input vs output.
Extra page margins are added to the output.

Dim MyDocument As Words.Document = New Words.Document(My.Application.Info.DirectoryPath + "\mht.mhtml", ASPLoadSetALL(Words.LoadFormat.Mhtml))
MyDocument.Save(My.Application.Info.DirectoryPath + "\out.htm", ASPSaveSetHTML(True))

input / output:
data.zip (7.7 KB)

@australian.dev.nerds This is not a bug. There is no guaranty to preserve original HTML document layout after open/save it using Aspose.Words. While loading HTML or any other document, Aspose.Words loads it into the Document Object Model, which is designed to work with MS Word documents at first. HTML document object model is quite different from MS Word one, so it is no always possible to preserve original document structure/layout/features after processing HTML documents using Aspose.Words.
By the way, if convert your MHTML document to HTML using MS Word, you will get the same result as Aspose.Words’.

1 Like