Security class

Security class

The PDF document security options.

For details, see the documentation.

The Security type exposes the following members:

Constructors

Constructor Description
init Initializes an instance of the Security class.

Properties

Property Description
document_open_password The password required to open the PDF document.
permissions The PDF document permissions such as printing, modification and data extraction.
permissions_password The password required to change permission settings.

Example

from groupdocs.viewer import Viewer
from groupdocs.viewer.options import PdfViewOptions, Security, Permissions

with Viewer("sample.docx") as viewer:
    security = Security()
    security.document_open_password = "o123"
    security.permissions_password = "p123"
    security.permissions = Permissions.ALLOW_ALL & ~Permissions.DENY_PRINTING

    pdf_options = PdfViewOptions("protected_document.pdf")
    pdf_options.security = security
    viewer.view(pdf_options)

Guides

Task guides that use Security:

See Also