Add PDF password
With this guide, you will learn how the Visual PDF API allows you to protect a PDF by adding a password that will prevent anyone from accessing the document without having entered it.
Basic password addition to PDF
The PDF protection tool by adding a password can be used in a pipeline via a add-password type task.
// Creating the form data for the pipeline
const form = new FormData();
form.append(
'tasks',
[
{
tool: 'add-password',
options: {
password: 'my_sup3r_s3cr3t_pwd',
},
},
],
);
Constraint of using an add password task
If your pipeline contains multiple tasks, the add password task should be last.
It is in fact useless and counter-productive to add a password to a temporary file which will be processed later by another task.
Files saved (temporarily) on our servers are in all cases encrypted and therefore unreadable. So you don't have to worry that a non-password protected file saved on our servers can be obtained in any way and then read.