当前位置:首页 > 未分类 > 正文内容

How to Add Password to PDF Documents in Google Drive

ceacer3周前 (05-02)未分类3839

The Document Studio add-on helps you create personalized PDF documents from Google Sheets. You can generate invoices, certificates, agreements, offer letters, student ID cards and other documents in bulk and save them to Google Drive.

Additionally, Document Studio now offers the option to protect the generated PDF documents with a password.

This functionality is particularly valuable in scenarios where the generated documents contain sensitive information that require extra protection to stop unauthorized access. For instance, you may generate invoices, or financial reports and protect them with a password before sharing them with clients or employees.

Add Passwords to PDF Documents

Let’s walk through the steps of adding passwords to PDF documents generated from Google Sheets using Document Studio.

Prepare Salary Data in Google Sheets

Employee Salary Slips in Google Sheets

We have a Google Sheet that contains the employee’s name, and the salary amount. We’ll use Document Studio to generate individual PDF salary slips for each employee and then add a password to each PDF document before saving them to Google Drive.

Create Template in Google Docs

We have created a salary slip template in Google Docs that contains placeholders for the employee’s name and the salary amount. The data from Google Sheet will be merged into this template to generate individual PDF documents for each employee.

Google Docs - Salary Template

Password Protect PDF Documents

Launch Document Studio in Google Sheets and create a new workflow. If you are new here, please refer to the step-by-step guide or watch this video tutorial to get started.

Inside the workflow, choose the Google Sheet that contains the employee data and the Google Docs template that you have prepared for the salary slips. Next, select the folder in Google Drive where the generated PDF documents will be saved.

Set the export format to PDF and enable the Password Protect PDF checkbox.

Create Password Protected PDF Documents

Unique Password for Each PDF Document

You can choose to use a common password for all the PDF documents or, for added security, set a unique password for each document. For this example, we’ll define a unique password for each PDF document using the employee ID and the first four letters of the employee’s name, all in uppercase.

For instance, if the employee ID is E345 and the employee’s name is Angus, the password for the corresponding PDF document will be E345ANGU.

We’ll make use of Scriptlets to derive a unique password for each PDF document dynamically.

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

The scriptlet above concatenates the employee ID with the first four characters of the employee’s name, converted to uppercase.

Generate PDF Documents

Save the workflow and run it to generate the PDF salary slips for all employees. The generated PDF documents will be saved to the specified Google Drive folder and each document will be protected with a unique password.

Also see: Remove PDF Password from Gmail Attachments

相关文章

Google Maps Formulas for Google Sheets

Google Maps Formulas for Google Sheets

You can bring the power of Google Maps to your Google Sheets using simple formulas with no coding. Y...

How Teachers can Email Parents of Students from Google Forms

How Teachers can Email Parents of Students from Google Forms

A school provides email accounts for students that are enrolled in high school. The school has publ...

How to Send SMS Messages with Google Sheets and Android Phone

How to Send SMS Messages with Google Sheets and Android Phone

The Mail Merge for Gmail add-on lets you send personalized emails via Gmail but wouldn’t it be nice...

How to Extract URLs from HYPERLINK Function in Google Sheets

The HYPERLINK formula of Google Sheets lets you insert hyperlinks into your spreadsheets. The functi...

How to Use Hyperlinks in Google Sheets

How to Use Hyperlinks in Google Sheets

This guide explains how you can easily create and manage hyperlinks in Google Sheets. An entire cell...

How to Create Dynamic Open Graph Images with Google Sheets

How to Create Dynamic Open Graph Images with Google Sheets

An open graph image (OG image) is the image that is displayed when any of your website links are sha...