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

Free Support Forum - aspose.com

Cell margins changed after converting HTML to DOCX and back

Hi,

When converting DOCX files to HTML then convert back to DOCX using Aspose.Words. I noticed the cell margins got unexpectedly changed.

Code:
var doc = new Document(@".\test.docx");
var htmlSaveOption = new HtmlSaveOptions();
htmlSaveOption.AllowNegativeIndent = true;
doc.Save(@".\out.htm", htmlSaveOption);
var htmlDoc = new Document(@".\out.htm");
htmlDoc.Save(@".\convertedBack.docx");

I’ve attached two sets of test documents (one original document is in compatibility mode and another one is not) both could replicate the issue. I’ve also attached a screenshot here.

test files.zip (41.4 KB)
image.png (44.5 KB)

In MS Word, we can save the DOCX to HTML then open it back using Word without losing/changing any of the styles. Could you help me check this?

@ServerSide527,

We tested the scenarios and have managed to reproduce the same problems on our end. For the sake of corrections, we have logged these problems in our issue tracking system. The IDs of these issues are WORDSNET-18154 (related to test.docx) and WORDSNET-18155 (related to test2.docx). We will further look into the details of these problems and will keep you updated on the status of corrections. We apologize for your inconvenience.