PasswordProtectOptionsBuilder

PasswordProtectOptionsBuilder

Builds a PasswordProtectOptions instance.

Methods

setUserPassword(userPasswordnon-null) → {PasswordProtectOptionsBuilder}

Description:
  • Sets the intended user password required for opening the encrypted PDF file. Allowed maximum length for the user password is 128 bytes.

Parameters:
Name Type Description
userPassword string

The user password.

Returns:

This Builder instance to add any additional parameters.

Type
PasswordProtectOptionsBuilder

setOwnerPassword(ownerPasswordnon-null) → {PasswordProtectOptionsBuilder}

Description:
  • 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:
Name Type Description
ownerPassword string

The owner password.

Returns:

This Builder instance to add any additional parameters.

Type
PasswordProtectOptionsBuilder

setEncryptionAlgorithm(encryptionAlgorithmnon-null) → {PasswordProtectOptionsBuilder}

Description:
  • 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:
Name Type Description
encryptionAlgorithm PasswordProtectOptions.EncryptionAlgorithm

The encryption algorithm.

Returns:

This Builder instance to add any additional parameters.

Type
PasswordProtectOptionsBuilder

setContentEncryption(contentEncryptionnon-null) → {PasswordProtectOptionsBuilder}

Description:
  • Sets the intended type of content to encrypt in the PDF file.

Parameters:
Name Type Description
contentEncryption PasswordProtectOptions.ContentEncryption

The type of content to encrypt.

Returns:

This Builder instance to add any additional parameters.

Type
PasswordProtectOptionsBuilder

setPermissions(permissionsnon-null) → {PasswordProtectOptionsBuilder}

Description:
  • 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:
Name Type Description
permissions Permissions

The permissions.

Returns:

This Builder instance to add any additional parameters.

Type
PasswordProtectOptionsBuilder

build() → {PasswordProtectOptions}

Description:
Returns:

A new ProtectPDFOptions instance.

Type
PasswordProtectOptions