Unable to run ExtractPages even from Trusted Function

New Here ,
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?

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

125

Likes

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

Unable to run ExtractPages even from Trusted Function

New Here ,
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?

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

126

Likes

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
Aug 07, 2017 0
Most Valuable Participant ,
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.

Likes

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
Reply
Loading...
Aug 07, 2017 0
New Here ,
Aug 08, 2017

Copy link to clipboard

Copied

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)

Likes

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
Reply
Loading...
Aug 08, 2017 0