Load Password-Protected Documents

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Comparison MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-comparison -- dnx GroupDocs.Comparison.Mcp --yes
Folders, licensing and more →

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