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

Spawn Template - Reset Fields- At end of Document

Community Beginner ,
Sep 10, 2018 Sep 10, 2018

Copy link to clipboard

Copied

Looking for a proper code that will do the following.

Button on header will add template to the end of the document "Add Page". This button carry over to the added page, and all fields reset. I want this to always add at the end of the document, even with the add button one say page 5 - i want the template to spawn on page 6, for example. Right now if i click add page on say - page 5, it places the new template after page 1.

Code currently

var a = getTemplate("Page");

a.spawn(numPages,true,false);

resetFieldsOnPage(pageNum+1);

TOPICS
PDF forms

Views

2.6K

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 2 Correct answers

LEGEND , Sep 26, 2019 Sep 26, 2019

I have no problem with spawning pages from a non-visible template using code similar to yours.

 

I spawn the first page with the template visible, then hide the template and rename all of the fields on the first page from "P1" to "P0" for the highest level field name.

 

var MyTemplate = this.getTemplate("MyTemplate");
MyTemplate.spawn({nPage: this.numPages, bRename: true, bOverlay: false});

Votes

Translate

Translate
Adobe Employee , Oct 11, 2019 Oct 11, 2019

Hi Trevorm,

 

You may also refer and try the sample code from the following Adobe discussions 

https://answers.acrobatusers.com/Spawning-pages-q293224.aspx

https://answers.acrobatusers.com/How-I-spawn-page-form-place-end-file-including-text-entered-in-q194936.aspx

 

Thanks,

Anand Sri.

Votes

Translate

Translate
LEGEND ,
Sep 26, 2019 Sep 26, 2019

Copy link to clipboard

Copied

I have no problem with spawning pages from a non-visible template using code similar to yours.

 

I spawn the first page with the template visible, then hide the template and rename all of the fields on the first page from "P1" to "P0" for the highest level field name.

 

var MyTemplate = this.getTemplate("MyTemplate");
MyTemplate.spawn({nPage: this.numPages, bRename: true, bOverlay: false});

Votes

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
Adobe Employee ,
Oct 11, 2019 Oct 11, 2019

Copy link to clipboard

Copied

LATEST

Hi Trevorm,

 

You may also refer and try the sample code from the following Adobe discussions 

https://answers.acrobatusers.com/Spawning-pages-q293224.aspx

https://answers.acrobatusers.com/How-I-spawn-page-form-place-end-file-including-text-entered-in-q194...

 

Thanks,

Anand Sri.

Votes

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