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

Trying to create a button to delete pages in a PDF

Community Beginner ,
Jul 16, 2020 Jul 16, 2020

Copy link to clipboard

Copied

Hi there! I'm not super familiar with interactive PDFs - It's been a while. 😉

 

I'm working on a doc that I would like to have buttons that would delete sections (multiplate pages) of the document. Essentially it's a collection of forms and we don't always need all of them. So I'm looking for a quick way to hit a button to remove them from the collection. 

 

Do I do that through Javascript? If so, how do I do that? Thank you!!! 

TOPICS
Acrobat SDK and JavaScript

Views

6.9K

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

correct answers 1 Correct answer

Adobe Employee , Jul 16, 2020 Jul 16, 2020

Hi there

 

Please use the script this.deletePages(0,3); from the first link shared esarlier and see if that works for you.
Note you can change the page range in the scrpit as per your requirement.

 

Regards

Amal

Votes

Translate

Translate
Adobe Employee ,
Jul 16, 2020 Jul 16, 2020

Copy link to clipboard

Copied

Hi Codyc

 

We are sorry for the trouble. As described you want to create a button to delete some pages from the PDF form.

 

Would you mind sharing if you have Adobe Acrobat Reader DC  (Freeware Application) or Adobe Acrobat DC (Subscription)?

You may please refer to the similar discussions below and see if that works for you.

 

1. Solved: button to delete pages - Adobe Support Community - 9084910

2. https://acrobatusers.com/forum/forms-acrobat/using-button-delete-pages/ 
Note: The scripts would not work with Adobe Acrobat Reader DC

 

Hope it will help

 

Regards

Amal

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 Beginner ,
Jul 16, 2020 Jul 16, 2020

Copy link to clipboard

Copied

Hi Amal! 

 

Thanks for the reply! I have the full version of Acrobat and the latest creative cloud subscription. 

 

I've attached a screenshot to show you what I mean - I think this is where I'd put the javascript but I'm not sure what script to copy/paste and how/where I would reference what pages I wanted deleted?

Screen Shot 2020-07-16 at 2.01.11 PM.png

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
Adobe Employee ,
Jul 16, 2020 Jul 16, 2020

Copy link to clipboard

Copied

Hi there

 

Please use the script this.deletePages(0,3); from the first link shared esarlier and see if that works for you.
Note you can change the page range in the scrpit as per your requirement.

 

Regards

Amal

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 Beginner ,
Jul 16, 2020 Jul 16, 2020

Copy link to clipboard

Copied

This is great Amal! I put it in and it worked - what I'm struggling with is the page range, 0,3 

If I have prefixes on my page numbers (example a1, b1, b2) how do I enter those into the script properly? 

Thanks so much for your help!

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

Copy link to clipboard

Copied

You don't. The script uses physical page numbers only (thankfully), not page labels. And those numbers are 0-based, so 0 means the first page in the file, and 3 means the fourth page. If you want to refer to the last page in the file you can do so using this.numPages-1 .

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 Beginner ,
Jul 16, 2020 Jul 16, 2020

Copy link to clipboard

Copied

LATEST

Thank you that is SUPER helpful! It worked for me! You are the best!!

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