POST
https://api.pdfblocks.com/v1/add_restrictions
Global endpoint (default)
POST
https://eu.api.pdfblocks.com/v1/add_restrictions
European-only endpoint
Parameters
The endpoint accepts multipart/form-data request bodies with the folowing parameters:
file
Required
The content of the input PDF document.
owner_password
Required
The password required to open and change permissions of the PDF document.
The length is between 4 and 32 characters.
The characters in the password must be in the ASCII printable range (between positions 32 and 126). This range includes lowercase and uppercase letters, numbers, space, and some commonly used symbols like . , : ; # $ % & ( ) * + = ? !
Both conditions as a regex pattern: ^[\x20-\x7e]{4,32}$
user_password
optional
The password required to open the PDF document.
If the user_password is set, the user will be able to open the document with either the user_password or the owner_password.
If the user_password is not set, the user will be able to open the document without a password.
The length is between 4 and 32 characters.
The characters in the password must be in the ASCII printable range (between positions 32 and 126). This range includes lowercase and uppercase letters, numbers, space, and some commonly used symbols like . , : ; # $ % & ( ) * + = ? !
Both conditions as a regex pattern: ^[\x20-\x7e]{4,32}$
encryption_algorithm
optional
The algorithm used to encrypt the file.
Valid values are AES-128 and AES-256
The default value is AES-128
allow_copy_content
optional
A boolean value indicating if the user can copy the text and images to the clipboard
The default value is true
allow_change_content
optional
A boolean value indicating if the user can change the content of the document
The default value is true
allow_print
optional
A boolean value indicating if the user can print the document
The default value is true
allow_print_high_resolution
optional
A boolean value indicating if the user can print the document in high resolution
The default value is true
allow_comment_and_fill_form
optional
A boolean value indicating if the user can add, edit and modify annotations and fill form fields
The default value is true
allow_fill_form
optional
A boolean value indicating if the user can fill forms fields
The default value is true
allow_assemble_document
optional
A boolean value indicating if the user can assemble and manipulate the document
The default value is true
allow_accessibility
optional
A boolean value indicating if accessibility programs can read the text and images of the document
The default value is true
Returns
If successful, the call returns a response with Content-Type: application/pdf with the content of the restricted PDF document. Otherwise, this call returns an error.