PDF.co can help you secure your files by requiring the owner or user passwords when people try to view or access your PDF files. This enables you to only allow intended users to see the contents of your PDF. As the file owner, you can allow and restrict actions such as file modification, text extraction, PDF printing to name a few.

PDF.co can also remove password protection in your PDF document. This will get rid of the security features added in the PDF as well.

Add or Remove Security Benefits

PDF File Protection

The Add PDF Security allows you to add separate owner passwords and user password protection. Aside from a password, there are other security features that can be enabled to protect the PDF file. These security features include user restriction from text extraction, file modification, PDF printing, filling out forms, and print quality.

Separate Owner and User Control

The Add PDF Security allows you to add PDF owner password and PDF user password. This enables the PDF owner to limit the file access to its intended users.

Remove PDF Protection

The Remove PDF Security can help you remove the existing password and security features in a PDF document. The PDF owner’s password is needed to remove the security feature.

On-Premise API Server

PDF.co offers on-demand and on-premise API Server. The on-demand hosts the API modules and generated files in our server, while, the on-premise API Server allows businesses to host the PDF.co API modules in their own servers. To try the on-premise API Server, please contact our customer support.

Sign Up

Access to API Integrations

We have a solid portfolio of PDF.co API integrations with powerful automation platforms. These integrations count Zapier and Integromat plugins, UiPath, and BluePrism plugins, but we have 300+ more integrations ready. You can easily connect with the most popular applications through our PDF.co API integrations.

Bulk PDF Processing

We understand that you need to protect and process your bulk PDF files. That is why our PDF Password and Security API can run asynchronously and in the background. Once the process is complete, you can then download your password-secured PDF files.

Furthermore, you can remove PDF passwords in bulk, which is important when handling client files in-house. The password removal feature is also included in the same API used to secure your PDFs with a password.

Add or Remove Security Integrations

PDF.co has over 300+ app integration. Kindly explore our following plugins:

Add PDF Security Samples & Codes

In this demonstration, we will use a 1-page PDF document and add owner and user password protection using the /v1/pdf/security/add endpoint. The image below shows the input PDF and the password protected PDF output.

Add PDF Security Input And Output PDF
Images of Input PDF and Password Protected PDF

Let’s go over the /v1/pdf/security/add endpoint’s parameters and their corresponding functions real quick.

Endpoint

URL: https://api.pdf.co/v1/pdf/security/add
Method: POST
Parameter Description
url required. URL to the source file.
ownerPassword The main owner password used for document encryption and setting restrictions
userPassword optional. User password for printing and viewing file.
encryptionAlgorithm AES_128bit or higher is recommended
allowAccessibilitySupport Allow or prohibit content extraction for accessibility needs.
allowAssemblyDocument Allow or prohibit assembling the document.
allowPrintDocument Allow or prohibit printing PDF document.
allowFillForms Allow or prohibit filling of interactive form fields including signature.
allowModifyDocument Allow or prohibit modification of PDF document.
allowContentExtraction Allow or prohibit copying content from PDF document.
allowModifyAnnotations Allow or prohibit interacting with text annotations and forms in PDF document.
printQuality Allowed printing quality. Valid values: HighResolution, LowResolution
encrypt optional. Enable encryption for the output file. Must be one true or false.
async optional. Runs processing asynchronously.
name optional. name of the output file.
profiles optional. Must be a String. Set custom configuration. See profiles examples here

 

cURL Code Snippet

curl --location --request POST 'https://api.pdf.co/v1/pdf/security/add' \
--header 'x-api-key: {{x-api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample1.pdf",
    "ownerPassword": "12345",
    "userPassword": "54321",
    "EncryptionAlgorithm": "AES_128bit",
    "AllowPrintDocument": false,
    "AllowFillForms": false,
    "AllowModifyDocument": false,
    "AllowContentExtraction": false,
    "AllowModifyAnnotations": false,
    "PrintQuality": "LowResolution",
    "encrypt": false,
    "name": "output-protected.pdf",
    "async": false
}'

The Add PDF Security cURL sample codes are available here.

Let’s see the Add PDF Security to PDF API in action using our cURL sample code.

Add PDF Security API Demo
Image of Add PDF Security Demo

The Add PDF Security JavaScript sample codes are available here.

The Add PDF Security PHP sample codes are available here.

The Add PDF Security Python sample codes are available here.

The Add PDF Security Java sample codes are available here.

The Add PDF Security C# sample codes are available here.

Remove PDF Security Samples & Codes

In this demonstration, we will show you how to remove the security features in a password-protected PDF. We will use the /v1/pdf/security/remove endpoint to accomplish this task. The image below is the password-protected input PDF and the PDF output.

Remove PDF Security Input And Output PDF
Image of Password-Protected PDF Input and PDF Output

Let’s go over the /v1/pdf/security/remove endpoint’s parameters and their corresponding functions real quick.

Endpoint

URL: https://api.pdf.co/v1/pdf/security/remove
Method: POST
Parameter Description
url required. URL to the source file.
password The owner/user password to open file and to remove security features.
encrypt optional. Enable encryption for the output file. Must be one true or false.
async optional. Runs processing asynchronously.
name optional. name of the output file.
profiles optional. Must be a String. Set custom configuration. See profiles examples here

 

cURL Code Snippet

curl --location --request POST 'https://api.pdf.co/v1/pdf/security/remove' \
--header 'x-api-key: {{x-api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-security/ProtectedPDFFile.pdf",
    "password": "admin@123",
    "name": "unprotected"
}'

The Remove PDF Security cURL sample codes are available here.

Let’s see the Remove PDF Security to PDF API in action using our cURL sample code.

Remove PDF Security Demo
Remove PDF Security Demo

The Remove PDF Security JavaScript sample codes are available here.

The Remove PDF Security PHP sample codes are available here.

The Remove PDF Security Python sample codes are available here.

The Remove PDF Security Java sample codes are available here.

The Remove PDF Security C# sample codes are available here.

Sign Up

Related Samples: