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