Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Dynamically password protecting PDFs


Level 1

Hello, I am interested in having users populate a static PDF form and clicking the "Submit E-mail" button to email the form to a fixed recipient. However, because the completed forms would contain sensitive information, I am interested in having the form password protect itself upon sending. Is this feasible using a custom script? Would I have to create my own button submission script to accomplish this?

To be clear, I don't want users filling out the form to have to enter any password. However, I would like for the PDF sent in an email to be password protected. Thanks in advance for any advice!

2 Replies


Level 1

What I am envisioning is that I create a custom button with the functionality of a built-in "Submit E-mail" button, but I would modify the "click" script to take the extra step of password protecting the PDF before it is attached to the email to be sent. My two questions would then be, is there a way to grab the "click" response script for the built-in "Submit E-mail" button, and what code would allow me to activate the password protection features in Adobe and automatically assign a password. My gut tells me this should be possible but then again, it also tells me I am asking way too much. Any help would be thus appreciated!


Level 10

You can do something like that but it would not be very secure.

1. You woudl have to change the built in submit button for a regular button so that you can add code to it.

2. You could replicate the submit functionality (it has been discussed many times on this forum).

3. You could add a field (hidden of course) that woudl act as a flag to indicate that the form has been submitted (as opposed to being saved by the user).

4. On th esubmit button you woudl put a value (like "Submitted") into the hidden field.

5. On the Doc Ready event of the form1 node you coudl add script that acts like this:

if (flagFieldName.rawValue == "Submitted"){

     var pswd = app.response("Enter the password to open the form!");

     if (pswd != "your magic password goes here") {

          app.alert("Password is not correct!")




You could make this code more robust (allow 3 tries at the password etc ....but teh technique is the same.

Make sense?