Copy link to clipboard
Copied
Looking for a proper code that will do the following.
Button on header will add template to the end of the document "Add Page". This button carry over to the added page, and all fields reset. I want this to always add at the end of the document, even with the add button one say page 5 - i want the template to spawn on page 6, for example. Right now if i click add page on say - page 5, it places the new template after page 1.
Code currently
var a = getTemplate("Page");
a.spawn(numPages,true,false);
resetFieldsOnPage(pageNum+1);
Copy link to clipboard
Copied
I have no problem with spawning pages from a non-visible template using code similar to yours.
I spawn the first page with the template visible, then hide the template and rename all of the fields on the first page from "P1" to "P0" for the highest level field name.
var MyTemplate = this.getTemplate("MyTemplate");
MyTemplate.spawn({nPage: this.numPages, bRename: true, bOverlay: false});
Copy link to clipboard
Copied
Hi Trevorm,
You may also refer and try the sample code from the following Adobe discussions
https://answers.acrobatusers.com/Spawning-pages-q293224.aspx
Thanks,
Anand Sri.
Copy link to clipboard
Copied
I have no problem with spawning pages from a non-visible template using code similar to yours.
I spawn the first page with the template visible, then hide the template and rename all of the fields on the first page from "P1" to "P0" for the highest level field name.
var MyTemplate = this.getTemplate("MyTemplate");
MyTemplate.spawn({nPage: this.numPages, bRename: true, bOverlay: false});
Copy link to clipboard
Copied
Hi Trevorm,
You may also refer and try the sample code from the following Adobe discussions
https://answers.acrobatusers.com/Spawning-pages-q293224.aspx
Thanks,
Anand Sri.