Skip to main content
Participant
May 18, 2022
Question

Removing filled out form pages from a PDF and putting them into a new PDF file using Javascript

  • May 18, 2022
  • 2 replies
  • 762 views

Hello,

 

I am unsure as to the capabilities of Acrobat Pro DC but from some sites that I have read it seems possible to implement this kind of functionality. Can any experienced users please advise if the following is possible using javascript from within a document.

 

I have a 350 page PDF that is a form. Customers can fill out any number of pages and so leave potentially hundreds of pages blank. I need a javascript that will scan through each page and find if any form elements have values and if so take the page and create a new file where they will all go. That way only the relevant pages will be extracted into a new file. 

I have come across links like this but since my programming knowledge is limited I'm not sure if this applicable to my scenario.

 

https://stackoverflow.com/questions/22118231/identify-and-extract-or-delete-pages-of-a-pdf-based-on-a-search-string-text-a

 

Any help or advice is appreciated and thanks in advance.

This topic has been closed for replies.

2 replies

JR Boulay
Community Expert
Community Expert
May 18, 2022

Acrobat Reader does not allow the creation of a new document.


It allows deleting pages, but only if they were spawned from a (hidden) template page, it doesn't work with "normal/static" pages.

Which might be complicated to do for a 350 pages document (but not impossible).

Acrobate du PDF, InDesigner et Photoshopographe
Bernd Alheit
Community Expert
Community Expert
May 18, 2022

Delete all not filled pages and save the file with a new name.

Bline9000Author
Participant
May 18, 2022

Ok thanks, any direction on how to achieve this?

Bernd Alheit
Community Expert
Community Expert
May 18, 2022

Compare the values of the fields with the default values. When the values are equal the field was not filled.

The property page of a field gives you the page or pages of the field.