Skip to main content
Participant
February 8, 2024
Question

Dropdown with numbers will populate specific fillable template pages

  • February 8, 2024
  • 1 reply
  • 340 views

I am building a fillable PDF template in Acrobat Pro that's 2 pages long with a third introduction page.  Can I, on the introduction page, have a dropdown with 1-10 and depending on the number chosen, it will populate that number of 2-page templates? 

 

1. Is that possible? 

2. How do I do that? 

3. What coding would I use to make that happen?

 

Thank you very much in advance!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
February 8, 2024

1. Yes.

2. Using a script. See #3.

3. In order to do it you would need to create two Template objects, one for each page.

Say they are called P1 and P2. To spawn new copies of them based on the selection in the drop-down you can use the following code as the custom Validation script of the latter:

 

 

var t1 = this.getTemplate("P1");
var t2 = this.getTemplate("P2");
for (var i=1; i<=Number(event.value); i++) {
	t1.spawn(this.numPages, true, false);
	t2.spawn(this.numPages, true, false);
}