• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Help spawning Template to the following page checkbox is located with visible/hidden properties.

New Here ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

Hi, I am working on a 5 page document that has a checkbox located on page 1 for supplemental information if needed.  When CB is selected, it makes template visible.  How do I add to the code to put it in the next page (page 2) of the document and not go to the end?  Below is the code that is currently in the checkbox.  I have searched multiple support threads and tried varies ways to add npage, but seem to be unsuccessful.  I am not a JS guru by all means.  Any help would be appreciated, thanks in advance!

 

if(event.target.value!="Off")
{this.getTemplate("Extended").hidden=false;}
else
{this.getTemplate("Extended").hidden=true;}

TOPICS
Acrobat SDK and JavaScript

Views

494

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
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 21, 2020 Apr 21, 2020

Use the method spawn.

Likes

Translate

Translate
Community Expert ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

Use the method spawn.

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
community guidelines
New Here ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

Thanks, figured it out!

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
community guidelines
New Here ,
May 13, 2020 May 13, 2020

Copy link to clipboard

Copied

Can you please tell me how you figured it out?  This is what I'm trying to do but the answer "use the method spawn" is not very helpful. 

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
community guidelines
Community Expert ,
May 13, 2020 May 13, 2020

Copy link to clipboard

Copied

You should start by learning a bit about writing code. 

www.pdfscripting.com

 

If you search this forum for the words template and spawn. You'll find many posts that provided example code.

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
community guidelines
New Here ,
May 13, 2020 May 13, 2020

Copy link to clipboard

Copied

Thank 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
community guidelines
New Here ,
Mar 14, 2022 Mar 14, 2022

Copy link to clipboard

Copied

I have the same question. I can't find anything on method spawn and JS is not my forte. I want this to hidden template to appear after the page with the checkbox/button and not at the end of the document. So I have 3 pages, when button is pressed to show the page template I want it to become page 3 and the original page 3 becomes page 4. I'd greatly help any assistance. 

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
community guidelines
Community Expert ,
Mar 15, 2022 Mar 15, 2022

Copy link to clipboard

Copied

LATEST

Doing it like that is problematic, unless you will only spawn one copy of each page. If you spawn more copies the names of the fields on them will become duplicated, because they are spawned from the same Template and to the same page number. A better solution is to spawn it to the last page, and then move it to the desired location, but that won't work in Reader.

 

Either way, this is not a simple scripting task. If you have no scripting experience I would recommend you hire a professional to do it for 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
community guidelines