Skip to main content
Participant
August 7, 2017
Answered

Unable to run ExtractPages even from Trusted Function

  • August 7, 2017
  • 1 reply
  • 493 views

I'm running Acrobat 8.31 on Windows 7 ... it's an old computer at my work

I don't think this should be hard. I am new to both JavaScript and JavaScript on Adobe, but I know Java and VBA pretty well.

From everything I've read, creating a trusted function and running extractPages from it should work and not be an error:

I test my function in the Debugger by passing in this...

test123(this);

(my code)

var test123 = app.trustedFunction(function(oDoc){

     <then later>

     oDoc.extractPages(previousPage, p, "file" + p);     //previousPage and p are variables that are initialized

     <later again

});

and I get this...

"NotAllowedError: Security settings prevent access to this property or method.

Doc.extractPages:20:Batch undefined:Exec"

I've have tried everything I can think of. Any idea why I would get this?

This topic has been closed for replies.
Correct answer try67

Where are previousPage and p defined? It will be better if you could post the full code.

Also, assuming "p" is a page number, you're missing the ".pdf" part of the file name in the last parameter of extractPages.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 7, 2017

Where are previousPage and p defined? It will be better if you could post the full code.

Also, assuming "p" is a page number, you're missing the ".pdf" part of the file name in the last parameter of extractPages.

Participant
August 8, 2017

Oh my goodness. I can't believe that. It wouldn't work because I failed to put the  + ".pdf" in extract pages. I literally spent the entire day yesterday rereading and editing my code when I just needed to say .pdf.


Thank you so much!!!

(Me so idiot)