Skip to main content
Known Participant
January 10, 2025
Question

The best way to create multiple check boxes....

  • January 10, 2025
  • 2 replies
  • 3154 views

over 40-odd pages in a document.

 

I can create multiple copies, but only to a maximum of approx 25 on one page.

 

I can duplicate the boxes over multiple pages, but then they are duplicates not individual fields so if I tick one box it'll tick them on all the other pages.

 

I want to keep the root name the same for all the checkboxes as I want to write a script at the end to summarise them all - but I can't do this if I copy and paste the checkbox.

 

Is there a better way of doing this, or do I just have to copy & paste my checkboxes and select fields at the end for the summary?

 

Thank you

2 replies

PDF Automation Station
Community Expert
January 10, 2025

Can't you create all the checkboxes on page one using Create multiple copies, then cut and paste them to the other pages?  Are the checkboxes in the same location on every page?  If so you can run a script in the console to create the fields on every page.

Known Participant
January 10, 2025

More or less. They may require some jiggling but not much.

PDF Automation Station
Community Expert
January 10, 2025

On page 1, create the first check box (named "Check Box" in this example);  Create multiple copies 25 down and 1 across.  Now you have Check Box.0 through Check Box.24.  Move the check boxes into place and run the following script in the console to create 25 uniquely named check boxes on pages 1 through 40 of the document in the same location as those on page 1:

var rects=[];
for(var i=0;i<25;i++)
{rects.push(this.getField("Check Box."+i).rect)}
var fldNum=25;
for(var i=1;i<this.numPages;i++)
{
for(var j=0;j<25;j++)
{
this.addField("Check Box."+fldNum,"checkbox",i,rects[j]);
fldNum++;
}
}
try67
Community Expert
January 10, 2025

Yes, there is. You can convert the page to a Template object and then spawn copied from it, with unique (but predictable named) field names on each copy. This requires using a script.

If you're interested, I've developed a (paid-for) tool that allows you to do it quickly and easily, without having to write any code yourself, and I'll be happy to help you set up the calculations after running the script, so you don't have to manually enter all the field names.

You can find it here: https://www.try67.com/tool/acrobat-duplicate-pages-of-a-pdf-file-including-form-fields

 

Known Participant
January 10, 2025

Thank you! I think that's the script I meant to buy from you but got the wrong one. I will check it out, thank you. I don't think you can do Templates unless you have a very high tech version of Acrobat (from my googling).

try67
Community Expert
January 10, 2025

Hmm I've got it to spawn pages (great) but not fields which is what I was aiming for. Do I have to create the fields on an absolutely blank page?


- You don't need a button to add each page. You can run the code from the JS Console.

- I thought you added the fields already... If not, you need to add them (via Tools - Prepare Form) to the page you defined as a Template, and then spawn copies from it. The fields won't be added or changed automatically after the spawning.