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.

Known Participant
January 10, 2025

Thanks so much for this!

 

I need approx 5 per page, for the next 40 or so pages. So I have created 5 copies down. I then put in the script but as it starts on page 5 and I have 5 fields, I've amended the script as below but nothing is happening which suggests that I have done it wrong!

 

I'm putting it in the console which comes up when I press CTRL+J, which I figure is where it should go...

 

var rects=[]; for(var i=0;i<4;i++) {rects.push(this.getField("LOC."+i).rect)} var fldNum=4; for(var i=5;i<this.numPages;i++) { for(var j=0;j<4;j++) { this.addField("LOC."+fldNum,"checkbox",i,rects[j]); fldNum++; } }


ETA I've added it to "document javascript strings", do I need to press anything to get it to run?

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

Well, you need Acrobat Pro to be able to do it via the application's UI, but if you use a script it's possible to do it in both Acrobat Pro or Acrobat Standard, but not in the free Acrobat Reader... However, in Reader you also can't add form fields, so I don't think you have that.