Load Password-Protected Documents

GroupDocs.Comparison for Python via .NET can compare password-protected documents. Supply the source password through a LoadOptions instance when constructing the Comparer, and the target password through a separate LoadOptions when calling add().

Example: Compare a password-protected source and target

from groupdocs.comparison import Comparer
from groupdocs.comparison.options import LoadOptions

def load_password_protected_documents():
    source_load = LoadOptions()
    source_load.password = "1234"

    target_load = LoadOptions()
    target_load.password = "5678"

    with Comparer("./source_protected.docx", source_load) as comparer:
        comparer.add("./target_protected.docx", target_load)
        comparer.compare("./result.docx")

if __name__ == "__main__":
    load_password_protected_documents()

source_protected.docx is a password-protected source file. Click here to download it.

target_protected.docx is a password-protected target file. Click here to download it.

Binary file (DOCX, 24 KB)

Download full output

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.