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

Extract Pages from Multiple PDFs

New Here ,
Jan 16, 2020 Jan 16, 2020

Copy link to clipboard

Copied

I have a set of over twenty PDFs, all with the same page layout but different content. I need to extract pages 7-8 from each PDF into a separate PDF, but not all in the same file. Thus:

  • PDF1 becomes pages.7-8_PDF1
  • PDF2 becomes pages.7-8_PDF2
  • PDF3 becomes pages.7-8_PDF3 etc.

I have tried using JavaScript, but cannot figure it out. Is there a way to accomplish this using JavaScript or Acrobat Actions without going through each file individually?

TOPICS
Acrobat SDK and JavaScript

Views

153

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 ,
Jan 16, 2020 Jan 16, 2020

Copy link to clipboard

Copied

LATEST

Yes there is. Use the "doc.extractPages()" function.

Here's the reference entry:

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_Acro...

 

Here's a simple script for an Action.

 

this.extractPages(6,7,this.path.replace(/\/([^\/]+\.pdf$)/i,"/pages.7-8_$1"));

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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