Copy link to clipboard
Copied
Hello, I have a PDF with 20 options and each option gives the user to personalize the option. I am going to use javascript to populate a receipt based on the options selected. Most will select a few options but if someone wants all 20 options, I will run out of room on a single page to list out the details. Can someone point me in the right direction to spawn a new template automatically?
See the Adobe Acrobat SDK JavaScript API Reference, "Template", starting on Page 662 and see examples for "spawn" method examples in page 663. Below is Example 2 taken from page 663, it copies the same template 1 time for the current page, for example.
var t = this.templates;
var T = t[0];
var XO = T.spawn(this.numPages, false, false);
for (var i=0; i<1; i++) T.spawn(this.numPages, false, false, XO);
You may want to add a conditionto have this script or similar execute when a user selects al
...Copy link to clipboard
Copied
See the Adobe Acrobat SDK JavaScript API Reference, "Template", starting on Page 662 and see examples for "spawn" method examples in page 663. Below is Example 2 taken from page 663, it copies the same template 1 time for the current page, for example.
var t = this.templates;
var T = t[0];
var XO = T.spawn(this.numPages, false, false);
for (var i=0; i<1; i++) T.spawn(this.numPages, false, false, XO);
You may want to add a conditionto have this script or similar execute when a user selects all 20 options in your PDF.