Skip to main content
Participant
March 25, 2017
Answered

Why is openDoc working in Reader XI but not Reader DC?

  • March 25, 2017
  • 2 replies
  • 1127 views

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:

  • The 'disclosed' property on secondary.pdf is set to true (document level javascript), but it still does not work
  • Both files are signed with my certificate and have been set as Trusted on the client machines running Reader XI and Reader DC. Even if I add the files to the Privileged Locations list for Reader DC, I get the same error.

Any ideas??

This topic has been closed for replies.
Correct answer try67

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.

2 replies

JR Boulay
Community Expert
Community Expert
March 27, 2017

Hi.

In Preferences : Enhanced Security : there is an "Add Host" button.

Did you try this?

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
March 25, 2017

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.

benlydmbAuthor
Participant
March 27, 2017

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?

benlydmbAuthor
Participant
March 27, 2017

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?