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

Extracting pages in pdf file

Community Beginner ,
Nov 30, 2023 Nov 30, 2023

I have a 693 page pdf file and need to extract every 3rd page.  Does anyone know how to accomplish this?

TOPICS
PDF
806
Translate
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 ,
Dec 05, 2023 Dec 05, 2023

Extract as separate files?

Translate
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 Beginner ,
Dec 06, 2023 Dec 06, 2023

Pages would be 3, 6, 9, 12 etc.  Then extracted into one file.

Translate
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 ,
Dec 06, 2023 Dec 06, 2023

Delete the unwanted pages and save the file with a new name.

Translate
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 ,
Dec 06, 2023 Dec 06, 2023

Do you mean pages 1, 4, 7, etc.?

What should be the names of the files when these pages are extracted?

Translate
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 Beginner ,
Dec 06, 2023 Dec 06, 2023

Pages would be 3, 6, 9, 12 etc.  Then extracted into one file.

Translate
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 ,
Dec 06, 2023 Dec 06, 2023
LATEST

As mentioned, it would be easier to do it by deleting all the other pages, and then saving the file under a new name. You can do that using this code:

 

for (var i=this.numPages-1; i>=0; i--) {
	if (((i+1)%3)!=0) this.deletePages(i,i);
}
this.saveAs(this.path.replace(this.documentFileName, "ExtractedPages.pdf"));

 

You can run it from the JS Console, for example.

Translate
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