Skip to main content
Known Participant
Sep 14, 2021 10:25 PM UTC
Question

Using "this.external" throws "InvalidGetError" when file is digitally signed

Hey guys, I've got a bit of a weird bug that is driving me completely insane.

 

I have a form that checks if PDF is being opened in something other than Acrobat using "if(this.external){"

Until recently, this worked perfectly. If the form was opened in Chrome or something else, an error would pop up and the form fields would stay hidden.

However, sometime between July and now, this stopped working, but only when the forms are digitally signed.

 

Reproduction:

1) Document-level script executes "if(this.external){//unhide form fields}" on document open.

2) User fills form and uses digital signature field to sign.

3) User emails form to my team.

4) My team opens the form and "//unhide form fields" doesn't execute, with this error in the console:

"InvalidGetError: Get not possible, invalid or unknown.

Doc.external:3:Document-Level:zOpenDoc"

 

In my testing, I found that removing the "this.external" check would also result in an error when the script got to the "this.delay = true" line, however "this.dirty = false" works fine.

 

I'm beyond frustrated and confused dealing with this. Is this a genuine bug with Acrobat or is this a coding error on my part?

I would greatly appreciate any help that points me in the right direction.

This topic is closed to new replies. Start a new post to keep the conversation going.

11 replies

Known Participant
Sep 15, 2021 12:58 PM UTC
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"); //Function that adjusts visibility of form fields

    getField("Status").readonly = false;
    switchStatus();
    if(getField("Admin.Customize") == null & & getField("Admin.Save") != null){this.removeField("Admin.Save");}
    this.delay = false;
    this.dirty = false;
};

Here's the code in the script zDocOpen. It should execute on document open. When digitally signed, it fails. 

Translate
try67
Community Expert
Community Expert
Sep 15, 2021 1:02 PM UTC

What's throwing the error is not the usage of the external property. It's you trying to change the visibility of fields, which is not allowed in a signed document.

Translate
Known Participant
Sep 15, 2021 6:59 PM UTC

I just tested that and that does not seem to be the case.
The attached file unhides a field On Open and then hides again On Save. Signed or not, it does not appear to throw any errors. 

Translate
try67
Community Expert
Community Expert
Sep 15, 2021 8:20 AM UTC

You need to ask the developers of the Chrome PDF plugin... It has nothing to do with Adobe.

Translate
Known Participant
Sep 15, 2021 10:02 AM UTC

Apologies for being unclear.

 

The issue is happening in Adobe Acrobat  Professional DC version 21.005.20060

 

Chrome is the reason that I need the code. 

Translate
Bernd Alheit
Community Expert
Community Expert
Sep 15, 2021 11:09 AM UTC

Does you get the error when you open the form in Adobe Acrobat?

Translate