Encrypt PDF

POST https://api.pdfrest.com/encrypted-pdf

Apply 256-bit AES encryption with a 32-bit key to a document. Encrypted PDFs cannot be viewed without first providing the open password.

Required form-data body parameters:

  • One of:
    • file - File to be uploaded and processed
    • id - Alphanumeric ID (UUID) of existing file on server to be processed
  • new_open_password - New password for the input document. Passwords must be 6-128 characters long.
  • current_open_password - Required if the input document already has an open password. Open password that was applied to the document. This password will be replaced by the value of new_open_password.
  • current_permissions_password - Required if the input document is already protected by a permissions password.

Optional form-data body parameters:

  • output - File name for output file (without extension)

Request Body

[{"name"=>"file", "value"=>nil, "datatype"=>"null"}, {"name"=>"id", "value"=>"xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "datatype"=>"string"}, {"name"=>"output", "value"=>"pdfrest_encrypted_pdf", "datatype"=>"string"}, {"name"=>"new_open_password", "value"=>"new_example_pw", "datatype"=>"string"}, {"name"=>"current_open_password", "value"=>"old_example_pw", "datatype"=>"string"}, {"name"=>"current_permissions_password", "value"=>"example_pw", "datatype"=>"string"}]

HEADERS

KeyDatatypeRequiredDescription
Api-Keystring