Introduced i 24.10 - Compare marks too much text as deleted and inserted

Starting with Aspose.Words 24.10, comparing files at the word level may incorrectly mark too much text as inserted and deleted.
Attached is an example, with the original file, the revised file, a code sample and the compare output generated with version 24.9 (showing a correct compare) and with version 24.10 (showing the incorrect compare).
Compare_V24_10_bug.zip (28.8 KB)

@andrelafond

It appears you are encountering an issue with Aspose.Words version 24.10, where the document comparison is incorrectly marking excessive text as inserted or deleted. This may be a bug introduced in that version.

To resolve this, you could revert to version 24.9, which you noted produces accurate comparison results. Additionally, you can adjust the CompareOptions settings to refine the comparison. For instance, you can ignore specific elements such as formatting, comments, or headers and footers, which may help reduce discrepancies.

Here’s a sample code snippet to configure the comparison options:

using Aspose.Words;
using Aspose.Words.Comparing;

// Load documents
Document docA = new Document("path/to/original.docx");
Document docB = new Document("path/to/revised.docx");

// Set up compare options
CompareOptions options = new CompareOptions
{
    IgnoreFormatting = true,
    IgnoreHeadersAndFooters = true,
    IgnoreComments = true,
    IgnoreTables = true,
    IgnoreFields = true,
    IgnoreFootnotes = true,
    IgnoreTextboxes = true
};

// Compare documents
docA.Compare(docB, "user", DateTime.Now, options);

// Check results
Console.WriteLine(docA.Revisions.Count == 0 ? "Documents are equal" : "Documents are not equal");

If the issue persists after trying these adjustments, consider reporting it to Aspose support along with your example files and code for further assistance.

The compare options in the code example are mandatory for us. For example, we know that this issue does not occur when comparing at the character level. We need a comparison at the word level. Also, given that many other compare issues have been addressed in 24.10, we do not want to stick to 24.9 and need to move forward with more recent versions of Aspose.Words.

@andrelafond
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-28651

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

William (Morse_Code),

thanks for following up by email. On September 25 above, I specifically confirmed that the options set in the code example we provided are required, including the ability to compare at the Word level. I also specifically mentioned that reverting to 24.9 is not an option give many compare fixes which were included in further released.

In an email last week on March 16 (which I do not see here on the Forum), you wrote that “reporting the specific word-level discrepancies to Aspose support is likely the best path for a functional patch.”. Isn’t it what I did by reporting this issue and by Apose confirming that the ticket WORDSNET-28651 was created? Please confirm that this ticket is still open.

Thanks in advance.

@andrelafond The message in the post was not posted by Aspose members. It looks like it was generated by some AI spam system. Therefore it was removed. Please ignore it and accept our apologies for your inconvenience.
The ticket reported in this thread is still open. We will keep you updated and let you know once it is resolved.

Thanks for your reply Alexey.

1 Like