Skip to main content
Participating Frequently
September 13, 2021
Question

Using javascript to extract pages from PDF

  • September 13, 2021
  • 1 reply
  • 2472 views

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 has been closed for replies.

1 reply

try67
Community Expert
Community Expert
September 13, 2021

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).

Sean 1982Author
Participating Frequently
September 14, 2021

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

try67
Community Expert
Community Expert
September 14, 2021

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)?