pdftools_toolbox.pdf.encryption

Classes

Encryption(user_password, owner_password, ...)

The password and permissions that should be applied to a document, when it is created using the pdftools_toolbox.pdf.document.Document.create() or pdftools_toolbox.pdf.document.Document.create_with_fdf() methods.

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() or pdftools_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 document pdftools_toolbox.pdf.document.Document.conformance . Note that encryption is not permitted for any PDF/A level pdftools_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 the pdftools_toolbox.pdf.encryption.Encryption.permissions parameter. The pdftools_toolbox.pdf.encryption.Encryption.owner_password may be used to open the document with no access restrictions. The pdftools_toolbox.pdf.encryption.Encryption.permissions may be None (all permissions), or a concatenation of the allowed pdftools_toolbox.pdf.permission.Permission values.

Parameters:
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 allowed pdftools_toolbox.pdf.permission.Permission values.

Returns:

pdftools_toolbox.pdf.permission.Permission