Word documents with checkboxes and form fields in table giving wrong comparison results in .NET

Hi,

I have a document that GroupDocs fail to run a comparison on, the original file is a quite large word document with a lot of checkboxes and fields.
However, The problem seems limited to a single table and cell.

It is not all that straightforward though; it doesn’t always simply fail, it also depends on which document is used as the source.

Setup
Files (different variations of a table): ExampleFiles.zip (62.8 KB)

  • FullTable.docx - Small table with two column including the problem cell in question
  • SingleColumn.docx - Same table but with the left column removed (still containing the bad cell)
  • BadCell.docx - Same table but all content removed except for the bad cell
  • TableTrouble.cs - Example code to do the comparisons (assumes you have a license)

Code (C# .NET Framework 4.8 - GroupDocs v20.5.0):

static void CompareDocuments(string source, string target)
{
    using (var comparer = new Comparer(source))
    {
        comparer.Add(target);
        comparer.Compare("result.docx");
    }
}

Result (Format is source -> target = Result)
FullTable/BadCell -> FullTable/SingleColumn/BadCell = DocumentComparisonException
SingleColumn -> FullTable = NullReferenceException (With a license)
SingleColumn -> SingleColumn/BadCell = Success

There are some weird interactions here:

  1. The behavior differs depending on which of the document is source.
  2. There is some content in the “bad” cell that GroupDocs cannot handle if it is present in the source (Bug?)
  3. Having a license cause the comparison “SingleColumn -> FullTable” to throw a NullReferenceException (Bug?)
  4. Without a license, the same comparison throws no exception, but the result is malformed. (Bug?)

@lars.olsson

This issue is reproduced at our end. Hence, we’ve logged it in our internal issue tracking system with ID COMPARISONNET-2349 for further investigation. As there’s any update, you’ll be notified.

@lars.olsson

You reported issue COMPARISONNET-2349 is now fixed in API version 20.6.

I can confirm that it works in 20.6, thank you.

1 Like

@lars.olsson

You are welcome.