How to Compare Invoices

For example, there are two invoices in the DOCX format and you need to compare their contents with the maximum level of detail and comparison sensitivity.

Invoice
Source
Target

GroupDocs.Comparison provides the ability to compare two files in DOCX format(or any other supported file formats) with adjustment of detalization level andcomparison sensitivity.

The following are the steps to compare two DOCX files with specific settings of detalization level andcomparison sensitivity.

The following code samples demonstrate how to compare two DOCX files.

Comparer comparer = new Comparer(SOURCE_FILE);
try {
    comparer.add(TARGET_FILE);
 
    final CompareOptions compareOptions = new CompareOptions();
    compareOptions.setSensitivityOfComparison(100);
    compareOptions.setDetalisationLevel(DetalisationLevel.High);
 
    comparer.compare(RESULT_FILE, compareOptions);
} finally {
    comparer.dispose();
}

As a result, we get a DOCX file where the deleted elements are marked in red, the added – in blue, and the modified – in green.

Result Invoice