Highlighted

Spawning template specifically & buttons in chrome.

New Here ,
Sep 18, 2020

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?

Adobe Community Professional
Correct answer by George_Johnson | Adobe Community Professional

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?

 

TOPICS
PDF forms

Views

67

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Spawning template specifically & buttons in chrome.

New Here ,
Sep 18, 2020

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?

Adobe Community Professional
Correct answer by George_Johnson | Adobe Community Professional

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?

 

TOPICS
PDF forms

Views

68

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 18, 2020 0
Adobe Community Professional ,
Sep 18, 2020

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?

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 18, 2020 0
New Here ,
Sep 19, 2020

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 19, 2020 0
Adobe Community Professional ,
Sep 20, 2020

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 20, 2020 0