Copy link to clipboard
Copied
Im trying to make a form. I got a page with buttons to spawn extra templates when need, but cant figure out how to spawn the page at a specific point in the pdf because they have a specific order. And be able to spawn all of them this way.
Heres my most recent code attempt(I know little javascript):
var a = this.getTemplate("TOC");
var s = 0;
if ( s<1 ){
s = 1;
var x = 2;
}
x = x + 1;
a.spawn(x,true,false);
Secondly, during testing I was opening the pdf via google and found that the buttons or spawning code wasnt working in google. Is that normal?
Yes, that's normal. Most non-Adobe PDF viewers have no support for templates or the JavaScript methods used to manipulate them.
That code doesn't make a lot of sense to me, since the following is functionally equivalent:
// Create a new page after the 4th page of this document
this.getTemplate("TOC").spawn(3, true, false);
Why all the variables?
Copy link to clipboard
Copied
Yes, that's normal. Most non-Adobe PDF viewers have no support for templates or the JavaScript methods used to manipulate them.
That code doesn't make a lot of sense to me, since the following is functionally equivalent:
// Create a new page after the 4th page of this document
this.getTemplate("TOC").spawn(3, true, false);
Why all the variables?
Copy link to clipboard
Copied
I was thinking the variables could be used so every time the button is pressed the nPage would increase by one.
Copy link to clipboard
Copied
Chrome is a web browser.
Would you expect an HTML file to work in Acrobat as in a web browser?