How to Compare Contracts 

You have two contracts in DOCX format that were concluded in different years (For example, for 2018 and 2019). You need to check how the conditions have changed after some time. Documents are encrypted, but you know the password from them. You can use the GroupDocs.Comparison option, enter your password into it and start the file comparison process.

File
Source
Target

GroupDocs.Comparison provides the ability to compare two files in DOCX format(or any other supported file formats).

The following are the steps to compare two DOCX files

  • Instantiate LoadOptions object and specify source document password;
  • Instantiate Comparer object with source document path or stream and LoadOptions object created at previous step;
  • Instantiate another LoadOptions object and specify target document password;
  • Call add method and specify target document path or stream and LoadOptions object created at previous step;
  • Call compare method.

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

Comparer comparer = new Comparer(SOURCE_FILE, new LoadOptions("source-password"));
try {
    comparer.add(TARGET_FILE, new LoadOptions("target-password"));
    comparer.compare(RESULT_FILE);
} 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 File