Free plan
Encrypt / Decrypt
Lock a PDF with a password or remove its password
About this tool
This tool protects a PDF with a password, or takes the protection off one. When you lock it, you set a password to open the file and can set what is allowed, such as printing or copying. To unlock a PDF you must type its current password. Keep your passwords safe, because a lost password cannot be recovered.
For example, you lock a PDF with your bank details so it needs a password to open before you e-mail it.
How to use it
- Choose this tool.
- Add your PDF.
- Choose to lock (encrypt) or to unlock (decrypt) it.
- Type the password. When locking, you can also set a separate password for permissions and choose what is allowed.
- Press Generate, then download the new PDF.
What you get back
You get a new PDF that is locked with your password, or one with the password removed. You can download it.
TEST IT LIVE
Try Encrypt / Decrypt in the Studio
One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Family
PDFs
Plan
Free
Method
POST
Endpoint
/v1/pdfs/security
Tool ID
pdfs.security
Authentication
API key
Accepts
PDF
Background jobs
Yes
Usage group
Pdf
For developers
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/pdfs/security" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'file=@document.pdf' \
-F 'operation=encrypt' \
-F 'keyLength=256' \
-F 'output_bundle=zip'Node.js
const { DavixH2I } = require('@davixlabs/h2i-sdk');
const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.pdfs.security({
"file": 'document.pdf',
"operation": "encrypt",
"keyLength": 256,
"output_bundle": "zip"
});
console.log(result.data, result.requestId);PHP
<?php
require 'vendor/autoload.php';
$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->pdfs()->security([
'file' => 'document.pdf',
'operation' => 'encrypt',
'keyLength' => 256,
'output_bundle' => 'zip',
]);
echo $result->requestId;Documentation
Guides that use this tool
More in PDFs
