Class Security_Api


  • public final class Security_Api
    extends Object
    The type Security api.
    • Constructor Detail

      • Security_Api

        public Security_Api()
    • Method Detail

      • removePasswordsAndEncryption

        public static void removePasswordsAndEncryption​(InternalPdfDocument internalPdfDocument)
        Removes all user and owner password security for a PDF document. Also disables content encryption.

        Content is encrypted at 128 bit. Copy and paste of content is disallowed. Annotations and form editing are disabled.

        Parameters:
        internalPdfDocument - the internal pdf document
      • getPdfSecurityOptions

        public static SecurityOptions getPdfSecurityOptions​(InternalPdfDocument internalPdfDocument)
        Get PDF security settings

        .

        Parameters:
        internalPdfDocument - the internal pdf document
        Returns:
        PdfSecuritySettings pdf security options
      • makePdfDocumentReadOnly

        public static void makePdfDocumentReadOnly​(InternalPdfDocument internalPdfDocument,
                                                   String ownerPassword)
        Makes this PDF document read only such that:

        Content is encrypted at 128 bit. Copy and paste of content is disallowed. Annotations and form editing are disabled.

        .

        Parameters:
        internalPdfDocument - the internal pdf document
        ownerPassword - The owner password for the PDF. A string for owner password is required to enable PDF encryption and all document security options.
      • setPdfSecuritySettings

        public static void setPdfSecuritySettings​(InternalPdfDocument internalPdfDocument,
                                                  SecurityOptions securityOptions)
        Set PDF security settings

        .

        Parameters:
        internalPdfDocument - the internal pdf document
        securityOptions - A SecurityOptions object.