Copy link to clipboard
Copied
I have a JavaScript type script that contains a trusted function with a SOAP transaction inside of the trusted function.
This function is inside of a folder level script.
When I call this function from a menu item, it works great.
When I try to add and call this function from a button or from a Signature Field under the execute JavaScript when signed, it will not work and I get an error message.
What am I missing and Is there a work around, I need to run from a button or from a Signed field?
Any Ideas?
// How to Run Privileged Javascript from a button
// 1. Need to place the needed Javascript inside of a function in the Javascripts folder
// 2. The Javascript must be a Trusted Function
// 3. Add the call to the trusted function to the button
//
// The Button Code for Run a Javascript on Mouse Focus is -> Trusted_CustomCode();
//
// The example below is a Folder Level JavaScript for Security Reasons
//
// The example code MUST BE encapsulated in a Trusted function which is part of <cust
...Copy link to clipboard
Copied
Not all menu items are available to Acrobat/Reader JavaScript for many reasons. For signatures it is a security issue and international standard that the person applying the signature can be verified each time the signature certificate is applied. This means the person applying the signature must enter his/her unique password each time the certificate is applied. Now if the user wants to share his/her password with another, then he/she must be willing to deal with the legal ramifications. Think about signing a multi-million dollar contract.
Copy link to clipboard
Copied
Thank you - but your reply is not on target.
I am trying to execute a JavaScript to update a database field to show that the document has been signed.
Copy link to clipboard
Copied
ADBC, Adobe Data Base Connection, was fully removed from Acrobat in version X.
Or if you are trying to update a field after the PDF has been signed you will invalidate the signature since the digital certificate by design is to indicate if any bit of any byte in the PDF has been changed. Also you may have locked all the fields by applying the digital certificate.
Copy link to clipboard
Copied
// How to Run Privileged Javascript from a button
// 1. Need to place the needed Javascript inside of a function in the Javascripts folder
// 2. The Javascript must be a Trusted Function
// 3. Add the call to the trusted function to the button
//
// The Button Code for Run a Javascript on Mouse Focus is -> Trusted_CustomCode();
//
// The example below is a Folder Level JavaScript for Security Reasons
//
// The example code MUST BE encapsulated in a Trusted function which is part of <custom_filename>.js in javascripts folder
//
var Trusted_CustomCode = app.trustedFunction(CustomCode);
function CustomCode() {
app.beginPriv();
//Custom JavaScript Code Goes Here
app.alert("This is my Custom Code that will run from a button");
// End of Custom Javascript Code
app.endPriv();
}
Copy link to clipboard
Copied
Glad you have it working. If you have time, can you let us know what you were doing wrong? For future reference, in cases like this, you should post the code you are using (or a radically simplified test case) and most especially the exact error message. Because... what you've posted is exactly what I'd expect you to have seen in the first case.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now