Load password-protected documents
Leave feedback
On this page
GroupDocs.Comparison allows you to compare documents that are protected with a password.
To compare password-protected documents, follow these steps:
- Instantiate the LoadOptions object. Specify source document password;
- Instantiate the Comparer object. Specify the source document path or stream and LoadOptions object created in the previous step.
- Instantiate another LoadOptions object. Specify target document password.
- Call the add() method. Specify the target document path or stream and the LoadOptions object created in the previous step.
- Call the Comparer method.
The following code snippet shows how to compare password protected documents:
import com.groupdocs.comparison.Comparer;
import com.groupdocs.comparison.options.load.LoadOptions;
// ...
try (Comparer comparer = new Comparer("source.xlsx", new LoadOptions("password"))) {
comparer.add("target.xlsx", new LoadOptions("password"));
comparer.compare("result.xlsx");
}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.