Skip to main content
Participant
January 31, 2018
Answered

how to use app.openDoc() api in AcroRd Reader?

  • January 31, 2018
  • 2 replies
  • 1381 views

how to use app.openDoc() api in AcroRd Reader?

I use this api to open a file,but I got an error as follow:

not allowed error security settings prevent access to this property or method

Anybody could help me?

This topic has been closed for replies.
Correct answer try67

From the documentation of openDoc:

A document cannot be opened during another Doc Open. In such cases, Viewer raises a

NotAllowedError action exception, which escript passes to the user.

2 replies

Participant
January 31, 2018

I add this javascript into pdf like this:

7 0 obj

<<

/Type /Action

/S /JavaScript

/JS (app.openDoc('/d/mydoc.pdf');)

>>

endobj

But I got this error:

NotAllowedError: security settings prevent access to this property or method

App.openDoc:2:Doc undefined:Open

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
January 31, 2018

From the documentation of openDoc:

A document cannot be opened during another Doc Open. In such cases, Viewer raises a

NotAllowedError action exception, which escript passes to the user.

Participant
January 31, 2018

Ok...All right~

Thank for your help!

try67
Community Expert
Community Expert
January 31, 2018

This method doesn't have any special restrictions in Reader, compared to Acrobat, except for the fact that you can't convert non-PDF files to PDF in Reader, obviously.

What is your full code, from where are you running it, and what is the full text of the error message you're getting?