Load password-protected documents

GroupDocs.Comparison allows to compare documents that are protected with a password.
The following are the steps to compare password-protected documents.

  • 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 Comparer method.

The following code sample shows how to compare password protected documents.

LoadOptions sourceLoadOptions = new LoadOptions(){ Password = "1234" };
 
using (Comparer comparer = new Comparer("source.docx", sourceLoadOptions))
{
	LoadOptions targetLoadOptions =	new LoadOptions() { Password = "5678" };
    comparer.Add("target.docx", targetLoadOptions);
    comparer.Compare("result.docx");
}

More resources

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App

Along with full-featured .NET library we provide simple, but powerful free Apps.
You are welcome to compare your DOC or DOCX, XLS or XLSX, PPT or PPTX, PDF, EML, EMLX, MSG and other documents with free to use online GroupDocs Comparison App.