I am trying to find any information about spawning the template page at the beginning of the document, but no luck. I only found this topic: https://community.adobe.com/t5/acrobat-sdk-discussions/spawning-pages-to-specific-spot-in-pdf/m-p/11...
but the documentation link is not valid anymore.
I wanted to spawn the template pages (2 of them) at the beginning of the document.
You can find the documentation of the Acrobat JS API in the Acrobat SDK.
However, if all you need is the spawn method, that's pretty straight forward. Here it is:
Funny detail in the context of the OP's task...
The nPage parameter is described as the 0-based page index after or on which the template is spawned while bOverlay says before or on the specified page...
Yes, it's a bit confusing. The correct one is the latter. The page is spawned before the specified page number. So if you specify "0" it will become the first page in the file; If you specify this.numPages it will be the last page, etc.
Thanks. Form is already working like it is supposed to.