• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Save only with a button

Community Beginner ,
Jan 15, 2020 Jan 15, 2020

Copy link to clipboard

Copied

Hello everybody,

I would like to create a PDF form which can only be saved with a button (Javascript!). Not with "Ctrl + S" or the menu command "Save". How can I realize that when opening the document, "Ctrl + S" and the menu command are deactivated and that saving after changes to the form only works via the button?
Is that even possible?

 

Thanks in advance for all helpful answers.

TOPICS
Acrobat SDK and JavaScript

Views

626

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 15, 2020 Jan 15, 2020

Copy link to clipboard

Copied

You can’t stop the standard functions from working. If you could install a script on every machine and each has paid Acrobat, you could add a save button to work also. Are you trying to protect an original file? If so just use normal system security. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 15, 2020 Jan 15, 2020

Copy link to clipboard

Copied

I would like that the form or changes to it can only be saved after completing all required fields and having signed. For example, I could give the check of this to the Save button via Javascript.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 15, 2020 Jan 15, 2020

Copy link to clipboard

Copied

you could use a document level script to check that field have been completed and give an alert on what is missing. you can add this to the document action will save event.

 

something like below may work, although i have never tested it on will save, i use it on an email submit button i put on forms.

 

   var bRtn = false;
   var aErrMsg = [];
   var rgEmpty = /^\s*$/;
   if(rgEmpty.test(this.getField("Date").value)) //check if the field has been filled
      aErrMsg.push("Date");
//duplicate the above if statement for any particular fields that need to be completed

   if(aErrMsg.length == 0)
      bRtn = true;
   else
// change the app alert message to what ever you want the user to see in the prompt
      app.alert("Submit Error\n\nThe following empty fields are required to be entered for a job request:\n\n   * " + aErrMsg.join("\n   * "));;

   return bRtn;

A bit thank to Thom Parker for the base of this script as i found it online from him. Sorry i dont know the link though.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 15, 2020 Jan 15, 2020

Copy link to clipboard

Copied

We often hear from people who are the victims of this terrible idea: who need to save a part-filled form (perhaps because of end of shift, a phone call, a system update, the need to look up information...) and who are unable to do so, or (probably worse) save the form then find it cleared when they reopen it.  It is really, really, best not to try to link the user's normal work (saving files in process) to input checking. When the file is ready it should be submitted, and the submit process can check the input. (Submit is not save, and submit is not email).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 15, 2020 Jan 15, 2020

Copy link to clipboard

Copied

I do completely agree with you with Test_Screen_Name.

 

I personally only use this code on a single page document for customers to request assistance. I then put the code on a button i call submit to generate a prefilled email with the form field information. customers can still save the document at any point they need, but using the form buttons cannot submit it to us unless complete. (i know they can go around this by just attaching the part filled document if they really wanted)

 

In circumstances like this i think it works well so on the receiving end we get all the data that is required to lodge a job.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 15, 2020 Jan 15, 2020

Copy link to clipboard

Copied

The background is that the form has several signature fields. certain fields of the form can be changed by the next user and should then be logged after his signature.
A changeable field, but the entry or the content at the time of the signature should be logged with every signature.
I hope I can express myself clearly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 15, 2020 Jan 15, 2020

Copy link to clipboard

Copied

I think i understand. You want the "save" disabled and only "save as" enabled so users cannot override previous filled data that has been filled by another user?

 

do you want particular fields made read only after each signature essentially?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 15, 2020 Jan 15, 2020

Copy link to clipboard

Copied

Not exactly. But I'm already doing something similar.

After signing, the information is copied from a few fields to another for logging and set to "read only".
That is another change. If the user closes the document and the request to save changes is denied, the signature is saved, but not the data to be logged.

 

Another approach would be to incorporate this process when the user clicks Sign. Afterwards he will automatically be asked to save.
Is it possible to pass javascript for this at this point?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 16, 2020 Jan 16, 2020

Copy link to clipboard

Copied

There is a Signed event that executes after a digital signature field has been signed, yes.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 16, 2020 Jan 16, 2020

Copy link to clipboard

Copied

After the user clicked "sign" but before the automatic prompt to "save as" comes up?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 16, 2020 Jan 16, 2020

Copy link to clipboard

Copied

LATEST

No. That event executes after the file has been saved, otherwise it would run before it was actually signed.

Votes

Translate

Translate

Report

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