Skip to main content
ashleyp58646075
Participant
August 11, 2016
Question

Spawing form and specifying placement

  • August 11, 2016
  • 3 replies
  • 677 views

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,

This topic has been closed for replies.

3 replies

Inspiring
August 11, 2016

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.

ashleyp58646075
Participant
August 11, 2016

That documentation isn't very easy for a beginner to interpret.  I was hoping someone would just post the code. 

Inspiring
August 11, 2016

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);