Copy link to clipboard
Copied
I have successfully been able to insert a template into the current form using the formula below, however it places the new page at the end of the document. I would like to insert the new page immediately after page 4. The formula I am currently using is:
var expTplt = getTemplate("pg 4");
expTplt.spawn(numPages,true,false)
I am a novice so please be specific as to what the formula should be to insert my template after page 4. If I can copy and paste it that would be fantastic. I am using Acrobat Pro DC.
Thank you,
Copy link to clipboard
Copied
You should look at the Acrobat JavaScript documentation for more information. It explains how the first parameter (nPage) is used, depending on whether you're adding a new page or overlaying the template on an existing page.
Copy link to clipboard
Copied
That documentation isn't very easy for a beginner to interpret. I was hoping someone would just post the code.
Copy link to clipboard
Copied
You're right, it is confusing because it's wrong about several things. It's been so long since I've taken a critical look at it that I hadn't noticed. So to give you some guidance, to spawn a template and have it create the new page after the fourth page of the document, set the nPage parameter to 4. In your example:
expTplt.spawn(4,true,false);
Find more inspiration, events, and resources on the new Adobe Community
Explore Now