Copy link to clipboard
Copied
Hi, I'm trying to create a button with a command to extract pages from a pdf. I need 2 buttons, one to extract a run of pages (27-32) and another button to extract 2 non sequential pages (27 & 32) I've been reading various forums and found some comments related to using the Console and one comment said "Extracting pages is for automation, not document interactivity. Automation scripts include JavaScript code run from the JavaScript Console, a Batch Process, or a Folder Level Script."
I have a pdf that I complete regularly, but then need to extract two sets of pages from the file and save in the same destination with the same file name but add "Client Copy 1" and "Client Copy 2" to the file name. Can this be done using script on a button?
If this is too complicated to arrange a file name, could it simply extract the relevant pages ready for me to then 'save as' This simple automation would help if it can be done?
Thanks.
So the "doc.extractPages" function will work in Acrobat Pro from a document script, so you can run it from a button on a PDF. However, since this is only for you, you can put a folder level script on your own system that will save the extracted pages to a predetermined file name and folder path.
here's the basic button script for just extracting the pages, but not saving
this.extractPages(1,3);
This code extracts pages 2 to 4 from the document.
Copy link to clipboard
Copied
So the "doc.extractPages" function will work in Acrobat Pro from a document script, so you can run it from a button on a PDF. However, since this is only for you, you can put a folder level script on your own system that will save the extracted pages to a predetermined file name and folder path.
here's the basic button script for just extracting the pages, but not saving
this.extractPages(1,3);
This code extracts pages 2 to 4 from the document.
Copy link to clipboard
Copied
Hi Thom, this works perfectly, thank you. What would the code be to extract non sequential pages, is that possible?
I need pages 27 & 32 for example from a 32 page document.
Thanks.
Phil
Copy link to clipboard
Copied
No. If you want to do it like that the options are:
- Create a new document and then import those pages into it, or
- Delete all the other pages in the file.
Copy link to clipboard
Copied
That's a shame, thanks very much for the response, much appreciated. 🙂 Have a good weekend.