Copy link to clipboard
Copied
Hi Guys
I would be grateful for some help with this as new to javascript.
Im looking to create an action within acrobat to batch delete pages. These PDF documents are varied with the total number of pages. I would like to delete all pages but keep the first and last two pages within the document, so 4 pages remaining after running the script.
Thanks
Alex
If you have Acrobat Pro create a new Action and have it execute this code, and a Save command:
if (this.numPages>4) {
this.deletePages(2,this.numPages-3);
}
Copy link to clipboard
Copied
If you have Acrobat Pro create a new Action and have it execute this code, and a Save command:
if (this.numPages>4) {
this.deletePages(2,this.numPages-3);
}
Copy link to clipboard
Copied
Thank you for your help.
One more thing, I would like to be able to save it as a new file adding 'aprf1' at the end of the PDF after action is complete. Here's what I have done, but it doesn't seem to be working.
var filename = this.path.replace(re,"");
if (this.numPages>4) {
this.deletePages(2,this.numPages-3);
cPath : filename + "_aprf1" + ".pdf"
}
Copy link to clipboard
Copied
Look at the options of the Save command. You can set it up there.
On Thu, Jun 8, 2017 at 2:50 PM, Shankster118 <forums_noreply@adobe.com>
Copy link to clipboard
Copied
Okay, Thanks for your help.
Copy link to clipboard
Copied
In the save step of the action you can specify the suffix.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now