Skip to main content
Known Participant
May 30, 2017 5:46 PM UTC
Answered

button to delete pages

In Acrobat XI, I want a button to delete 4 pages.

Scenario, an 8 page PDF, first 4 pages are instructions. Once the form is complete, the user can click the button and the pages 1 to 4 will delete. Leaving you only the 4 remaining form pages.

I did have something before,...still looking.

This topic is closed to new replies. Start a new post to keep the conversation going.
JR Boulay
JR BoulayCorrect answer
Community Expert
May 30, 2017 8:19 PM UTC

Yes, Reader XI and DC can spawn pages and can delete pages that have been spawned, even if they where spawned in a previous session.

Acrobate du PDF, InDesigner et Photoshopographe

21 replies

Participant
Apr 1, 2021 11:29 PM UTC

Is there a script that I can use to delete the current page (regardless of page number) and the next 1 or 2 pages after it?

Any help would be appreciated!

 

Also, is there a way to get my TOC to update automatically if a portion of my form is deleted because it no longer applies? (ie. instructions for a bread maker on page 22 and 23 - person doesn't have a bread maker - clicks a button to delete page 22 and 23, and the table of contents no longer shows "Bread Maker Instructions" - for example)

Translate
Thom Parker
Community Expert
Community Expert
Apr 2, 2021 12:54 AM UTC

console and folder level script can delete and insert pages, but not scripts in a document, i.e. form scripts.

Updating TOC pages is not realistic. However, it might be possible to recreate the TOC pages with a scirpt, depending whats required for the graphics, fonts etc.

Take a look at these resources:

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_AcroJS%2FDoc_methods.htm%23TOC_deletePagesbc-20&rhtocid=_6_1_8_23_1_19

https://www.pdfscripting.com/public/Automating-Acrobat.cfm

 

  

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
May 30, 2017 7:55 PM UTC

This code will do that:

this.deletePages(0,3);

Note it won't work in Reader, though. Only in Acrobat.

Translate
murrjamesAuthor
Known Participant
May 30, 2017 8:09 PM UTC

Is there something that will work in Reader. Also will spawning a new page from a template work in reader?

Translate
JR Boulay
Community Expert
JR BoulayCommunity ExpertCorrect answer
Community Expert
May 30, 2017 8:19 PM UTC

Yes, Reader XI and DC can spawn pages and can delete pages that have been spawned, even if they where spawned in a previous session.

Translate
Acrobate du PDF, InDesigner et Photoshopographe