Class PasswordProtectParams.Builder

    • Constructor Detail

      • Builder

        public Builder()
        Constructs a Builder instance.
    • Method Detail

      • setUserPassword

        public PasswordProtectParams.Builder setUserPassword​(String userPassword)
        Sets the intended user password required for opening the encrypted PDF file. Allowed maximum length for the user password is 128 bytes.
        Parameters:
        userPassword - the user password; can not be null or empty
        Returns:
        this Builder instance to add any additional parameters
      • setOwnerPassword

        public PasswordProtectParams.Builder setOwnerPassword​(String ownerPassword)
        Sets the intended owner password required to control access permissions in the encrypted PDF file. This password can also be used to open/view the encrypted PDF file. Allowed maximum length for the owner password is 128 bytes.
        Parameters:
        ownerPassword - the owner password; can not be null or empty
        Returns:
        this Builder instance to add any additional parameters
      • setEncryptionAlgorithm

        public PasswordProtectParams.Builder setEncryptionAlgorithm​(EncryptionAlgorithm encryptionAlgorithm)
        Sets the intended encryption algorithm required for encrypting the PDF file. For AES-128 encryption, the password supports LATIN-I characters only. For AES-256 encryption, passwords supports Unicode character set.
        Parameters:
        encryptionAlgorithm - the encryption algorithm; can not be null
        Returns:
        this Builder instance to add any additional parameters
      • setContentEncryption

        public PasswordProtectParams.Builder setContentEncryption​(ContentEncryption contentEncryption)
        Sets the intended type of content to encrypt in the PDF file.
        Parameters:
        contentEncryption - the type of content to encrypt; can not be null
        Returns:
        this Builder instance to add any additional parameters
      • setPermissions

        public PasswordProtectParams.Builder setPermissions​(Permissions permissions)
        Sets the intended permissions for the encrypted PDF file. This includes permissions to allow printing, editing and content copying in the PDF document. Permissions can only be used in case the owner password is set.
        Parameters:
        permissions - the permissions; can not be null
        Returns:
        this Builder instance to add any additional parameters