Load password-protected documents

On this page

GroupDocs.Comparison allows you to compare documents that are protected with a password.

To compare password-protected documents, follow these steps:

  1. Instantiate the LoadOptions object. Specify source document password;
  2. Instantiate the Comparer object. Specify the source document path or stream and LoadOptions object created in the previous step.
  3. Instantiate another LoadOptions object. Specify the target document password.
  4. Call the add() method. Specify the target document path or stream and the LoadOptions object created in the previous step.
  5. Call the compare() method.

The following code snippet shows how to compare password-protected documents:

const comparer = new groupdocs.comparison.Comparer(sourceExcelDocument, new groupdocs.comparison.LoadOptions("password"));
comparer.add(targetExcelDocument, new groupdocs.comparison.LoadOptions("password"));
comparer.compare(resultExcelDocument);

On this page