Skip to main content
Participating Frequently
Sep 13, 2021 8:42 PM UTC
Question

Using javascript to extract pages from PDF

Each month I get a large pdf file that I need to extract pages from and resave. The page numbers rarely change so this can had been working:

 

this.extractPages(0,1, "table1.pdf");

this.extractPages(2,15, "table2.pdf");

etc. for many more tables.

 

I recently "upgraded" to Adobe Acrobat Pro DC version 2021.005.20058

 

the code no longer works. I get an error message:

RaiseError: The file may be read-only, or another user may have it open. Please save the document with a different name or in a different folder. Doc.extractPages:1:Console undefined:Exec

 

There is no possible way for another user to have the file open - I just created it. I have searched on this error and seen many solutions, however none of them solve the problem.

This topic is closed to new replies. Start a new post to keep the conversation going.

10 replies

try67
Community Expert
Community Expert
Sep 13, 2021 8:50 PM UTC

Go to Edit (or the Acrobat app menu if you're on a Mac) - Preferences - Security (Enhanced) and disable Protected View Mode (or something similar).

Translate
Sean 1982Author
Participating Frequently
Sep 14, 2021 11:13 AM UTC

That's not it. Using a PC, Protected View is already off.

Translate
try67
Community Expert
Community Expert
Sep 14, 2021 11:24 AM UTC

How many pages are there in the file? What's the name of the original file? Where is the original file located (under what folder)?

Translate