How to Encrypt and Password-Protect a PDF in Power Automate

Cloudmersive
3 min readOct 3, 2024

--

Applying security policies to a PDF prevents unwanted document viewers from opening and accessing its contents.

In Power Automate, we can easily encrypt our PDF documents and lock them with a password using a Cloudmersive PDF connector action.

Walkthrough

In this walkthrough, we’ll set up a quick instant cloud flow in Power Automate that applies encryption & password protection policies to a PDF in our file system.

Create an instant cloud flow

We’ll start by retrieving a PDF document from our file system using a Get file content action.

Retrieve a PDF file with a Get file content action

Next, we’ll add a new action and search for Cloudmersive connectors. We’ll scroll down until we find the Cloudmersive PDF connector on this list.

Search for Cloudmersive connectors; find the Cloudmersive PDF connector

We’ll click “See more” to view the actions list, and from there, we’ll search for an action titled Encrypt, password-protect and set restricted permissions on a PDF.

Search for the Encrypt, password-protect and set restricted permissions on a PDF action

After we select this action, we’ll need to create our Cloudmersive API connection.

We can use Cloudmersive connectors for free with a free API key. Free API keys allow a limit of 800 API calls per month with no additional commitments (once we reach our limit, our total will reset the following month).

After we’ve created our connection, we’ll add our PDF file bytes and file name to their respective parameters. We’ll then enter owner and reader passwords.

Configure the Encrypt, password-protect and set restricted permissions on a PDF request

If we click “Show all” to view the advanced parameters, we’ll have the option to customize our encryption algorithm and set various restricted permissions for our PDF.

Review Encrypt, password-protect and set restricted permissions on a PDF advanced parameters

We’ll now add an Update file action to our flow and replace the original PDF file bytes with the encrypted & password-protected file bytes.

Update the original PDF file with the encrypted & password-protected PDF contents
Test the flow to apply the changes

Just like that, we’ve applied custom security policies to our PDF document, ensuring unsolicited document viewers can’t access the PDF contents.

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

No responses yet