Copy link to clipboard
Copied
I'm hoping someone can help me with the correct code to plug into Javascript so I don't have to spend hours doing this by hand. Basically, I have a set of 666 unique 8-page surveys collated into a single PDF, totalling 5,328 pages. The first page of each survey has a unique identifier code and I need to extract each first page into a separate PDF (due to a printing error, we need to re-print these first pages). So, I need some way to extract page 1, 9, 17, 25 ... 5,321. I don't know the first thing about Javascript and hardly anything about Acrobat, I would appreciate if anyone could provide me an appropriate input for Javascript to accomplish this.
Copy link to clipboard
Copied
You can do it using this code:
for (var i=0; i<this.numPages; i+=8)
this.extractPages(i, i, this.path.replace(/\.pdf$/i, "_p"+(i+1)+".pdf"));
You can run it from the JS Console, an Action or a Custom Command.