Extract Pages from Multiple PDFs

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, How to

Views

24

Likes

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

Extract Pages from Multiple PDFs

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, How to

Views

25

Likes

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

Copy link to clipboard

Copied

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"));

 

 

Likes

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
Reply
Loading...
Jan 16, 2020 0