UpdateFields() adds unwanted paragraph

Hello,

After upgrading from Aspose.Words 15.7 to 17.8 we noticed a change of behaviour after executing UpdateFields() method on a modified document. An additional, unwanted, paragraph is added which results in an unwanted new line. We’ve also tested with the newest version of Aspose.Words - 18.10.

Here is a part of the document generated with version 15.7:
img15_7.PNG (1.2 KB)

And here is the same document generated with version 18.10 (“Date” is moved to a new line):
img18_10.PNG (1.8 KB).

Here you can see the difference in document.xml between source document and version 18.10:
diff_source_18.10.PNG (75.7 KB)

And here you can see the difference in document.xml between 15.7 and 18.10:
diff_15_7_18_10.PNG (73.8 KB)

Here are all 3 documents: source, generated with 15.7 and generated with 18.10 and LinqPad scripts that can be used to reproduce the issue.
files.zip (53.2 KB)

The source document is saved after performing modification on the document but before runnig UpdateFields() method, so it is in a broken state - cannot be opened in Word.

Can this issue be fixed, as this is a problem for our customers?

Best regards,
Urszula Godlewska

I

@jhas

Thanks for your inquiry. Your input document does not open in MS Word 2016. Please ZIP and attach correct input Word document here for testing. We will investigate the issue on our side and provide you more information.

Hi,

The source document was generated by our code using DocumentFormat.OpenXml. It cannot be opened in Word before executing UpdateFields() method on this document. Everyting was woking fine before upgrading to Aspose 17.8. As you can see on screens attached previously, a new paragraph is added where it is not supposed to be added. It can be verified by comparing document.xml files from the docx package. I’m attaching a simplified version of the three documents: source, output from 15.7 and output from 18.10.
files.zip (49.1 KB)

Best regards,
Urszula Godlewska

@jhas

Thanks for your inquiry. We have logged an issue as WORDSNET-17607 in our issue tracking system to check either it is bug or not. We will investigate the issue and provide you more information on it.

Please note that Aspose.Words mimics the behavior of MS Word. We need to investigate this issue by opening your input document in MS Word and check the behavior of MS Word. Please share the document that can be opened in MS Word.