Skip to main content
Participant
November 18, 2024
Question

Using Prepare Form to Create Fillable PDF Except for Specified Pages

  • November 18, 2024
  • 3 replies
  • 230 views

I am attempting to create a fillable PDF where every 7th page (1st, 8th, etc) does not have any fillable fields using the Prepare Forms form field auto detect. Is this possible? These pages are, more or less, tables of contents so they do not need to filled out.

This topic has been closed for replies.

3 replies

try67
Community Expert
Community Expert
November 18, 2024

You can use this code to do it, but notice it will only work on fields that have a single "widget", ie. not for fields with more than one instance with the same name:

 

for (var i=this.numFields-1; i>=0; i--) {
	var fname = this.getNthFieldName(i);
	var f = this.getField(fname);
	if (f==null) continue;
	if (typeof f.page=="number" && f.page%7==0) 
		this.removeField(f.name);
}
PDF Automation Station
Community Expert
Community Expert
November 18, 2024

I don't believe you can select the pages for auto detect, but it's easy to delete any fields created on the pages you didn't want them on by selecting all fields on those pages in the field panel and pressing the delete key.  If this will take too much time because you have too many pages you can run a script in the console that will delete them for you.

Participant
November 18, 2024
Oh sure, you can leave fields/pages unprepared. Just go to the pages you want to work on.



Stephen
Participant
November 18, 2024

Thanks for the quick reply. Can you explain the steps for doing this? Or provide a link to them?