• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Unable to run ExtractPages even from Trusted Function

New Here ,
Aug 07, 2017 Aug 07, 2017

Copy link to clipboard

Copied

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?

TOPICS
Acrobat SDK and JavaScript , Windows

Views

308

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 07, 2017 Aug 07, 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.

Votes

Translate

Translate
Community Expert ,
Aug 07, 2017 Aug 07, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 08, 2017 Aug 08, 2017

Copy link to clipboard

Copied

LATEST

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines