Copy link to clipboard
Copied
I have a 14 page pdf in which i need to offer the user the option of adding additional pages 5-8, however, I need to offer it in pairs now. So, spawning 5+6 together after the original page 6 and deleting the original page button. Then the option of spawning 7+8 together after the original page 8 and deleting the original button.
Currently, it is set up to spawn each page singularly. Can I just update the script to spawn two page templates instead of just one? This is my script. TIA! This forum is wonderfully helpful.
this.getField("Additional Page 5").display=display.noPrint;
var a = this.getTemplate("5");
a.spawn({nPage: pageNum + 1, bRename: true, bOverlay: false});
this.getField("Additional Page 5").display=display.hidden;
event.target.display=display.hidden;
this.pageNum=this.pageNum+1;
Copy link to clipboard
Copied
You can add a second getTemplate and spawn.
Copy link to clipboard
Copied
You just have to repeat the spawning instruction:
this.getField("Additional Page 5").display=display.noPrint;
var a = this.getTemplate("6");
a.spawn({nPage: pageNum + 1, bRename: true, bOverlay: false});
var a = this.getTemplate("5");
a.spawn({nPage: pageNum + 1, bRename: true, bOverlay: false});
this.getField("Additional Page 5").display=display.hidden;
event.target.display=display.hidden;
this.pageNum=this.pageNum+1;