How to delete all pages after the 2nd page?

Explorer ,
Dec 19, 2018

Copy link to clipboard

Copied

Good evening, I am trying t create an action that will delete all the pages after the 2nd page of the document, then save the file to a different folder.

I have tried using the "Delete pages" action, and that didn't work. but saving the file to another folder works just fine.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Add a command to run this JavaScript code, and then save the file:

this.deletePages(2, this.numPages-1);

TOPICS
Acrobat SDK and JavaScript, Windows

Views

81

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

How to delete all pages after the 2nd page?

Explorer ,
Dec 19, 2018

Copy link to clipboard

Copied

Good evening, I am trying t create an action that will delete all the pages after the 2nd page of the document, then save the file to a different folder.

I have tried using the "Delete pages" action, and that didn't work. but saving the file to another folder works just fine.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Add a command to run this JavaScript code, and then save the file:

this.deletePages(2, this.numPages-1);

TOPICS
Acrobat SDK and JavaScript, Windows

Views

82

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
Dec 19, 2018 0
Most Valuable Participant ,
Dec 19, 2018

Copy link to clipboard

Copied

Add a command to run this JavaScript code, and then save the file:

this.deletePages(2, this.numPages-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...
Dec 19, 2018 1
Adobe Community Professional ,
Dec 19, 2018

Copy link to clipboard

Copied

You'll need to use JavaScript for this. Just one line.

this.deletePages(2,this.numPages-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...
Dec 19, 2018 1