Copy link to clipboard
Copied
I've asked about this, at least tangentally, previously, but I didn't understand what was happening.
I have a form that doesn't work right in other PDF viewers, especially Chrome. To prevent user complaints (so many), I hide every field and mark it read only, except a big angry warning to open the form in Adobe Acrobat/Reader. Then, using an On Doc Open script, I check this.external == false and set everything's visibility and usability, plus hide the angry warning. Additionally, I use app.alert to pop up our privacy policy regarding this specific form.
However, if the form has been digitally signed none of this works. This prevents the warning from going away and it never shows the privacy policy. BUT my script that sets global-level variables works just fine.
I know I can replicate this behavior with "On Page Open" and a RunOnce variable, but I'd like to keep this simple if I can.
This all used to work just fine. Did something change in Adobe Acrobat? And is there a way around or better way to do this?
-Azure's Skye
Copy link to clipboard
Copied
Hi,
Can you update teh version of Acrobat you are using and which OS, and are you able to share a sample document that shows the problem?
I have been able to add a script to a file, and have this script run ( showing a simple dialog) and then sign the document and re-open the file and the dialog still shows.
Acrobat DC Pro : 2022.001.20085
OSX : 12.2
Copy link to clipboard
Copied
I've been digging to isolate the problem. But I haven't been able to make a simple form that displays the issue. I'm worried I'll have to post the actual form I'm working on, which will impact my privacy 😞
The specific error I get is:
InvalidGetError: Get not possible, invalid or unknown.
Doc.external:3:Document-Level:zDocOpen
While the code for that script is: (I included XML Tags for reference)
//<Document-Level>
//<ACRO_source>zDocOpen</ACRO_source>
//<ACRO_script>
/*********** belongs to: Document-Level:zDocOpen ***********/
//If the form is opened in a non-Adobe product, it'll be readonly and pop up an error.
function DocOpen(){
if(this.external){
app.alert({
cMsg: "This form does not work in your chosen PDF viewer. Please use Adobe Reader or Adobe Acrobat.",
nIcon: 0,
nType: 0,
cTitle: "Bad PDF Viewer"});
} else { //Unlock the Status field and process
this.delay = true;
actionSetVis("Show");
getField("Status").readonly = false;
switchStatus();
if(getField("Admin.Customize") == null && getField("Admin.Save") != null){this.removeField("Admin.Save");}
this.delay = false;
this.dirty = false; //prevents Adobe from asking to save the form again.
};
};
//Required by law. Runs on open every time because there's no conditional.
//Moved from "SORN" to zDocOpen to place it after all other scripts are defined.
app.alert({
cMsg: "AUTHORITY FOR MAINTENANCE OF THE SYSTEM:\n\
10 U.S.C. 8013, Secretary of the Air Force and E.O. 9397 (SSN).\n\
\n\
PURPOSE(S):\n\
Used to locate or identify personnel assigned/attached to, tenanted on, or on temporary duty at the specific installation, office, base, unit, function, and/or organization in response to specific inquiries from authorized users for the conduct of business. Portions of the system are used for directory service and forwarding individual personal mail received by Air Force postal activities, and for assignment of individual mailboxes. Files may be used locally to support official and unofficial programs that require minimal locator information, membership or user listings.\n\
\n\
ROUTINE USES OF RECORDS MAINTAINED IN THE SYSTEM, INCLUDING CATEGORIES OF USERS AND THE PURPOSES OF SUCH USES:\n\
In addition to those disclosures generally permitted under 5 U.S.C. 552a(b) of the Privacy Act, these records or information contained therein may specifically be disclosed outside the DoD as a routine use pursuant to 5 U.S.C. 552a(b)(3) as follows:\n\
\n\
The DoD 'Blanket Routine Uses' published at the beginning of the Air Force's compilation of systems of records notices apply to this system.\n\
\n\
DISCLOSUE: Voluntary. Failure to supply this information may result in fewer services being available and you will not be able to recieve electronic notifications of recieved mail.\n\
\n\
Submission of this form qualifies as consent for your information to be used as necessary.",
nIcon: 3,
nType: 0,
cTitle: "Privacy Act Statement"});
//Runs SigExtract on open, in case the SigExtract didn't save when first signed
if(getField("Mbr.Sign").signatureInfo().status > 0 && getField("Mbr.Name.Last").value == "Auto filled when signed"){
Sign();
};
DocOpen();
//</ACRO_script>
//</Document-Level>
I actually work in two versions. And I have the issue in both versions.
Work:
Acrobat DC Pro: 2022.001.20085
Windows 10, Version 1909, Build 18363.2158
Home:
Acrobat 2017 Pro: 2017.012.30205
Windows 10, Version 21H2, Build 19044.1620
Copy link to clipboard
Copied
Annnnnd I just yeeted half my private info out the window by not sanitizing that code.
Is there an edit button here? I can't find it...
Copy link to clipboard
Copied
I think someone removed it for you... I don't see any private info in your post, at any rate.
Copy link to clipboard
Copied
Whelp, since I spoilt my privacy already, here's one of the actual forms that I'm having issues with.
Notably, this form does not exhibit the broken behavior until it's completely filled out an "Print" or "Email" is pressed.
Which means it's gotta be deeper than I thought.
-Azure's Skye
Copy link to clipboard
Copied
This is just a random thought, not tested, but I believe running JavaScript is "form filling". Therefore if you lock a file (by signing or security) and don't allow form filling, I'd not be surprised to find that the JavaScripts were dead.
By the way, to remove a post or attachment, click Report and explain what you need to the moderator who will eventually read it.
Copy link to clipboard
Copied
I don't lock the fields or the file. Other JavaScripts run fine, but only after the document opens.
I know a work around for this would be a "On Page Open" script with a run once statement.
Thanks for the info about removing posts! I think I'm just going to leave this up. It's not severe, but it's still more than I wanted to share. Oh well...
-Azure's Skye
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more