Will Save Script Please!

New Here ,
Mar 30, 2019

Copy link to clipboard

Copied

I need to place a JavaScript in Document Actions in a PDF form filler I created. I have created several fields that I listed as "required fields" in the form. I was hoping that I could insert a Script that will return a message informing the user that they have not filled out all of the required fields when they try to click Save as or Print. I have the document saved as a read-only. It is my intention that the user will not be able to save a copy or print a copy of the document until they have filled out the required fields.

P.S. You would think that it wouldn't be very hard to remember to fill in your address and phone number but here we are.

TOPICS
Acrobat SDK and JavaScript

Views

60

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Mar 30, 2019

Copy link to clipboard

Copied

The methods are "will save" and "will print". You can do various things, and issue messages, but it WILL then save or print; you cannot stop it.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
try67 LATEST
Most Valuable Participant ,
Mar 31, 2019

Copy link to clipboard

Copied

Although it's not possible to completely prevent the file from saving or printing, it is possible to force the printed/saved copy to have all the form fields in it blank (while still showing them on screen), or to display an error message, if not all the required fields are filled-in.

To do that you would need to use a script to validate the fields in each of the Will-events.

I've developed a (paid-for) tool that allows you to set it up very easily. You can find it here: Custom-made Adobe Scripts: Acrobat -- Validate Required Fields Before Printing or Saving

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more