Copy link to clipboard
Copied
Is the any way to run a javascript action from a signed form signature box that will rename the form from a this.getField("Your Field".value and set a new folder location? Bonus: plus send an email notification through Outlook that a form needs to be signed...
Copy link to clipboard
Copied
- To save a file under a specific name requires running the code from a trusted function. See:
https://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript
https://acrobatusers.com/tutorials/trust-and-privilege-in-acrobat-scripts
- You can trigger a submit command of the file using JavaScript like this:
this.submitForm({cURL: "mailto:me@server.com", cSubmitAs: "PDF"});
Copy link to clipboard
Copied
The problem I'm having is not the script, but having it execute after the windows API initiates a Save As; after you sign the form. I need the script to trigger after that event.
Copy link to clipboard
Copied
Place the script under the Signed event of the Signature field.
Copy link to clipboard
Copied
I'm digging that idea, but that will only work after the document is signed; the API triggers before that. I'm currently playing around with a folder level script to work off a button call, since I got the script to work in the debugger, but it can't be called with a button...if that doesn't work i have a few more ideas. Thanks for the hit though !!!!!!!
Copy link to clipboard
Copied
I thought about it and came up with a solution. You can use a script as the document's Did Save event and have it check the value of the signature field. If it's not blank then you know the file has been signed (and saved), and then you can execute your code. The script itself is something like this (adjust the name of the signature field as needed, of course):
if (this.getField("Signature1").valueAsString!="") {app.alert("the file was signed and saved.",3);}