• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Extract every nth page of a large (>5,000 page) PDF

New Here ,
Feb 06, 2023 Feb 06, 2023

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. 

TOPICS
Edit and convert PDFs

Views

218

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 08, 2023 Feb 08, 2023

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines