Content control range is changed after converting docx to html and back

Hi,

When converting a docx to html, then convert it back to docx using Aspose.Words. I noticed in some cases the range of the content control is not properly kept.

Code:
var sourceDoc = new Document(@".\test.docx");
sourceDoc.Save(@".\outhtm.htm");
var htmlDoc = new Document(@".\outhtm.htm");
htmlDoc.Save(@".\outword.docx");

There are two tables each has 3 content controls next to each other. After the conversion, the range of content controls in the 1st table was unexpectedly changed, while the content controls in the 2nd table were properly aligned.

I’ve attached the test files and a screenshot for your reference. Could you help me check this issue?

test.zip (24.7 KB)
image.png (26.8 KB)

Thanks,

@ServerSide527

Thanks for your inquiry. We have tested your provided document using the latest version of Aspose.Words 18.12 and found no issue. Please make sure you are using the latest version of Aspose.Words for .NET 18.12 .

Please check document and image for your reference.
outword_18.12.zip (7.7 KB)
Content Controll

Thanks for your reply.

I was using Aspose.Words 18.12. I’ve checked your output and found the issue exists. The content control 2 is supposed to be next to content control 1, according to the original document. But in the output, in the first table, the content control 2 is wrapped into content control 1.

I’ve attached some screenshots made from your output to better explain the issue:
Content Controls in the first table of the output file:
image.png (2.9 KB)
Content Controls in the second table of the output file:
image.png (3.0 KB)

In the original document, The range of ‘Content Control 1’ does not include ‘Content Control 2’:
image.png (3.9 KB)
image.png (8.7 KB)

Thanks,

@ServerSide527

Thanks for detailed explanation of the issue. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-17955 . You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-17955) have been fixed in this Aspose.Words for .NET 19.7 update and this Aspose.Words for Java 19.7 update.