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

Extracting multiple pages by page label

New Here ,
Mar 18, 2019 Mar 18, 2019

Copy link to clipboard

Copied

Hi

I'm trying to extract single and multiple pages based on pre-defined page label names. Probably as an action.

I understand the basics of extracting pages and page labels but can't tie it all together. Any pointers?

Thanks

TOPICS
Acrobat SDK and JavaScript , Windows

Views

445

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 ,
Mar 18, 2019 Mar 18, 2019

Copy link to clipboard

Copied

You need to better explain the situation. What are the labels in your file and how do they relate to the way you want to extract the pages?

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
New Here ,
Mar 18, 2019 Mar 18, 2019

Copy link to clipboard

Copied

The labels are various page labels. Some are numbers, some are letters and numbers eg. A200.

I want to extract specific pages from a list of page labels and save them as new files.

Hope that makes sense.

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
Community Expert ,
Mar 18, 2019 Mar 18, 2019

Copy link to clipboard

Copied

Where is this list coming from?

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
New Here ,
Mar 18, 2019 Mar 18, 2019

Copy link to clipboard

Copied

I have a list of page labels. They could be put into the code by hand.

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
Community Expert ,
Mar 18, 2019 Mar 18, 2019

Copy link to clipboard

Copied

So you have a list of page labels and you want to find the matching pages and extract them as new files, saving them using the label names?

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
New Here ,
Mar 18, 2019 Mar 18, 2019

Copy link to clipboard

Copied

Yes correct

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
Community Expert ,
Mar 18, 2019 Mar 18, 2019

Copy link to clipboard

Copied

You can use something like this:

var names = ["Page 1", "Page 2", "Cover page"];

for (var p=0; p<this.numPages; p++) {

    var pageLabel = this.getPageLabel(p);

    if (names.indexOf(pageLabel)!=-1) {

        this.extractPages(p, p, pageLabel + ".pdf");

    }

}

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
New Here ,
Mar 18, 2019 Mar 18, 2019

Copy link to clipboard

Copied

That's great thanks so much.

Would it be possible to do it for a range of pages as well? Eg "Page1 - Page 6". Where those pages run concurrently, so from "Page 1" to "Page 6".

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
Community Expert ,
Mar 18, 2019 Mar 18, 2019

Copy link to clipboard

Copied

Yes, but it will require a more complex script, especially if you want to compare each one of them to the list.

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
New Here ,
Mar 18, 2019 Mar 18, 2019

Copy link to clipboard

Copied

LATEST

I'll see if I can work out how to put it together.

Thanks so much for your help though. Appreciated.

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