Toggle Template Pages

New Here ,
Feb 08, 2019

Copy link to clipboard

Copied

Afternoon

I am creating a form and would like to have 4 radio buttons that when clicked on spawn a hidden template (this bit i have got).  what i also want it do do is if i select a different radio button it spawns another associated template page but deletes the other. This is so only one template page can be visible at any time.

So i have 4 templates, lets say "Template1", "Template2", "Template3", "Template4".

Is this possible. I am new to java so the simpler it is explained the better.

Thanks

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Yes. Read the documentation of the spawn method of the Template object and the deletePages method of the Document object.

TOPICS
Acrobat SDK and JavaScript

Views

143

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

Toggle Template Pages

New Here ,
Feb 08, 2019

Copy link to clipboard

Copied

Afternoon

I am creating a form and would like to have 4 radio buttons that when clicked on spawn a hidden template (this bit i have got).  what i also want it do do is if i select a different radio button it spawns another associated template page but deletes the other. This is so only one template page can be visible at any time.

So i have 4 templates, lets say "Template1", "Template2", "Template3", "Template4".

Is this possible. I am new to java so the simpler it is explained the better.

Thanks

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Yes. Read the documentation of the spawn method of the Template object and the deletePages method of the Document object.

TOPICS
Acrobat SDK and JavaScript

Views

144

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
Feb 08, 2019 0
Most Valuable Participant ,
Feb 08, 2019

Copy link to clipboard

Copied

It's not Java, it's JavaScript (one word). We never shorten it to Java because Java is something else important. This may seem like needless detail, but if you search the web for info or tutorials on Java, you will get completely wrong information that will confuse and delay you.

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...
Feb 08, 2019 0
Most Valuable Participant ,
Feb 08, 2019

Copy link to clipboard

Copied

Are you spawning the page as the last page of the file, or something else? How many pages are there in the file before and after you spawn it?

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...
Feb 08, 2019 0
New Here ,
Feb 08, 2019

Copy link to clipboard

Copied

Sorry. I have 6 pages showing, so 7 when page is spawned. I would like to spawn after page 2 if possible. If it has to be last then that would be ok

Thanks

Brett

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...
Feb 08, 2019 0
New Here ,
Feb 11, 2019

Copy link to clipboard

Copied

is this possible

thanks

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...
Feb 11, 2019 0
Most Valuable Participant ,
Feb 11, 2019

Copy link to clipboard

Copied

Yes. Read the documentation of the spawn method of the Template object and the deletePages method of the Document object.

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...
Feb 11, 2019 1