pdftools_toolbox.pdf.encryption
Classes
|
The password and permissions that should be applied to a document, when it is created using the |
- class pdftools_toolbox.pdf.encryption.Encryption(user_password: str | None, owner_password: str | None, permissions: Permission)[source]
Bases:
_NativeObject
The password and permissions that should be applied to a document, when it is created using the
pdftools_toolbox.pdf.document.Document.create()
orpdftools_toolbox.pdf.document.Document.create_with_fdf()
methods. The encryption algorithm (e.g., MD4, AES) will be the highest level of encryption that is supported for the documentpdftools_toolbox.pdf.document.Document.conformance
. Note that encryption is not permitted for any PDF/A levelpdftools_toolbox.pdf.document.Document.conformance
.- __init__(user_password: str | None, owner_password: str | None, permissions: Permission)[source]
The
pdftools_toolbox.pdf.encryption.Encryption.user_password
may be used to open the document with the permissions defined by thepdftools_toolbox.pdf.encryption.Encryption.permissions
parameter. Thepdftools_toolbox.pdf.encryption.Encryption.owner_password
may be used to open the document with no access restrictions. Thepdftools_toolbox.pdf.encryption.Encryption.permissions
may be None (all permissions), or a concatenation of the allowedpdftools_toolbox.pdf.permission.Permission
values.- Parameters:
userPassword (Optional[str])
ownerPassword (Optional[str])
permissions (pdftools_toolbox.pdf.permission.Permission)
- property user_password: str | None
The user password opens the document with the permissions defined by the
pdftools_toolbox.pdf.encryption.Encryption.permissions
parameter.- Returns:
Optional[str]
- property owner_password: str | None
The owner password opens the document with no access restrictions.
- Returns:
Optional[str]
- property permissions: Permission
The permissions that will be granted to a user who opens the document using the
pdftools_toolbox.pdf.encryption.Encryption.user_password
. The value is either null (all permissions), or a concatenation of the allowedpdftools_toolbox.pdf.permission.Permission
values.- Returns:
pdftools_toolbox.pdf.permission.Permission