How to Automatically Encrypt and Password-Protect a PDF

Are you generating a lot of new PDFs, and dreading the tedious task of securing them? Never fear — with our PDF Encryption API, you can automatically set an owner password to control editor/creator permissions, and set another user/reader password to control PDF viewership. You may also, of course, set the password fields to “null” to omit the given password if you prefer.

With the JavaScript code examples provided below, you can easily structure your API call and put your PDF protection worries aside. To authenticate API access, quickly register a free account on our website to receive your API key.

Let’s get started. First, run the below command to install jQuery:

After that, use the below snippet to input your PDF file:

Now you’re only one step away: copy in the below code block to complete the API call, and include your API key where indicated in the code:

--

--

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

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

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