Skip to main content

Protect PDF Documents with Password

Document Studio can automatically protect the merged PDF documents with a password. This feature is useful when you are generating sensitive documents like invoices, payslips, or finance reports and you want to ensure that only authorized users can access the document.

To password-protect the generated PDF documents, open the Create File task in Document Studio and choose PDF as the output format.

Next, check the Password Protect PDF File option and enter the password that will be required to open the PDF document.

PDF Password File

Dynamic Passwords

You can use a fixed password for all the generated documents or you can use dynamic values from the merged sheet to set a unique password for each document.

For instance, if you have a column titled Password in your Google Sheet, you can put {{Password}} in the password field and the corresponding document will be protected with the password that is found in that row.

Alternatively, you can build the password using a combination of static text and dynamic values from the merged sheet.

For instance, if you want to use the first four characters of the employee's name as the password in uppercase, you can make use of a string scriptlet in the password field. Assuming that there's a column in your sheet titled Employee Name, the password field will be:

{? "{{Employee Name}}" | upcase | slice: 0, 4 ?}

The upcase filter will convert the name to uppercase and the slice filter will extract the first four characters of the name.