Copy link to clipboard
Copied
I am going nuts trying to figure this out. I've browsed past forum posts and none of them seem to apply to my particular situation.
I have a form ("primary.pdf") I created in Acrobat XI with a button that runs a javascript on Mouse Up that takes its form data and inserts it into another form I created ("secondary.pdf"). The two files are in the same directory on a Windows network server. The javascript on the button has the following line 38:
app.openDoc("secondary.pdf", this);
When primary.pdf is open on a windows client running Reader XI, I can click the button and the script works great. When primary.pdf is open on a different windows client running Reader DC, I get the following error output in the console:
NotAllowedError: Security settings prevent access to this property or method.
App.openDoc:38:Field Button1:Mouse Up
The only way it will work in Reader DC is if I disable Protected Mode at startup (in Preferences -> Security (Enhanced)), but this has obvious negative ramifications.
I also noticed that if if secondary.pdf is already open in another Reader DC window/tab, it will not throw an error; if I click the button in primary.pdf with secondary.pdf already open, then it runs just fine.
Additional info:
Any ideas??
I think you answered your own question... For it to work Protected View has to be turned off.
One thing you can try is to place the openDoc command in a trusted function in a folder-level script. Maybe if you do it like that then it will open without having to disable Protected View.
Copy link to clipboard
Copied
I think you answered your own question... For it to work Protected View has to be turned off.
One thing you can try is to place the openDoc command in a trusted function in a folder-level script. Maybe if you do it like that then it will open without having to disable Protected View.
Copy link to clipboard
Copied
I tried placing openDoc in a trusted function in a folder-level script, but it still gives me the same error message (and references the app.openDoc() function call in the folder-level .js file).
What is frustrating is that neither the Acrobat XI nor AcrobatDC javascript api references describe any security restrictions for the app.openDoc() method. Meanwhile, the doc.saveAs() method does have security restrictions and I am able to get this to work in a trusted function in the javascript of the same button.
try67, can you offer up any other possible solutions without having to disable Protected View?
Copy link to clipboard
Copied
Another useful bit of info:
When I open the PDF with the button from a thumb drive inserted into the client machine, the script runs fine. It appears it does not consider the network location to be a "safe path" and thus throws the exception (as described in the safe path discussion in the API reference). As before, I tried running the script from the file on the network (after adding the both the network folder and the files as Privileged Locations) and it still doesn't work.
Any ideas on how to make the network location a "safe path", or create a safe path on the network server?
Copy link to clipboard
Copied
I think you have to mount it to a drive.
Copy link to clipboard
Copied
Hi.
In Preferences : Enhanced Security : there is an "Add Host" button.
Did you try this?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now