Set a Password for the Resultant Document
Leave feedback
On this page
GroupDocs.Comparison for Python via .NET can apply a password to the comparison result. Combine CompareOptions.password_save_option = PasswordSaveOption.USER with SaveOptions.password = "<your password>".
from groupdocs.comparison import Comparer
from groupdocs.comparison.options import CompareOptions, SaveOptions, PasswordSaveOption
def set_password_for_resultant_document():
with Comparer("./source.docx") as comparer:
comparer.add("./target.docx")
compare_options = CompareOptions()
compare_options.password_save_option = PasswordSaveOption.USER
save_options = SaveOptions()
save_options.password = "3333"
comparer.compare("./result.docx", save_options, compare_options)
if __name__ == "__main__":
set_password_for_resultant_document()
source.docx is the source file used in this example. Click here to download it.
target.docx is the target file used in this example. Click here to download it.
Binary file (DOCX, 25 KB)
Opening result.docx will require the password 3333.
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.