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.
Web API engines work in any programming language: PHP, Javascript, C#, .NET and ASP.NET, Java, Visual Basic, and many others.
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 a PDF owner password and a PDF user password. This enables the PDF owner to limit the file access to its intended users.
Remove PDF Protection
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.
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.
Web API Supports Multiple Languages
Programmers can run Web API engines at the PDF.co platform using the following programming languages: C#, PHP, Javascript, .NET and ASP.NET, Java, Visual Basic, and many others.
If you need to get specific coordinates in PDF, you can use this simplified PDF Viewer tool. It is available in PDF.co Web API and its integrations.
More PDF.co Options to Protect Your PDF
PDF.co provides various options for protecting PDF documents, including password protection, watermarking, encryption, redaction, digital signatures, converting to image, and making PDF unsearchable. These options allow you to control who can access and modify the document, prevent text from being copied or edited, hide sensitive information, and ensure the authenticity of the document.
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.
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 source code samples are available here.
Let’s see the Add PDF Security to PDF API in action using our cURL sample code.
Image of Add PDF Security Demo
The Add PDF Security JavaScript source code samples are available here.
The Add PDF Security PHP source code samples are available here.
The Add PDF Security Python source code samples are available here.
The Add PDF Security Java source code samples are available here.
The Add PDF Security C# source code samples 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.
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 source code samples are available here.
Let’s see the Remove PDF Security to PDF API in action using our cURL sample code.
Remove PDF Security Demo
The Remove PDF Security JavaScript source code samples are available here.
The Remove PDF Security PHP source code samples are available here.
The Remove PDF Security Python source code samples are available here.
The Remove PDF Security Java source code samples are available here.
The Remove PDF Security C# source code samples are available here.