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

Spawning Pages to specific spot in PDF

New Here ,
May 13, 2020 May 13, 2020

Copy link to clipboard

Copied

I have a fillable PDF that triggers a hidden page template when the button "Add Benefit" is clicked.  However, it always places that spawned page at the end of the document and I need it to go after page 5 and continue to go in order if button clicked on the subsequent spawned pages that pull in.  I have searched for the Javascript syntax to do so but am not having any luck finding it for my specific situation.  

 

Current syntax is: 

 

var a = this.getTemplate ("Add Benefit");a.spawn();

 

I know it needs something about nPage or numPage but I can't figure if it needs the bRename or any of the bOverlay commands.

 

Any help would be greatly appreciated! 

TOPICS
Acrobat SDK and JavaScript

Views

388

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

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

I have already looked at this.  This is my first time ever with Javascript so I do not know how to extrapolate the options given into actual code.  Which is why I posted here.

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

Do you have any experience with programming? There are a lot of details, and I think you'd find it worthwhile to spend some time learning the basics.

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
Community Expert ,
May 12, 2022 May 12, 2022

Copy link to clipboard

Copied

Hi,
You can use the "spawnPageFromTemplate" method:

https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/html2015/index.html#t=Acro12_MasterBook%...

If you want the page after the page #5 (before the page #6) you must set the nPage parameter to 5 (0-based number for the page #6).

Set "bOverlay" to false for a new page.

Setting bRename to false will not rename the fields with a prefix, so if you spawn several time the template, all the fields with the same name will get the same value.

Have a look on the attached file.

@+

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 12, 2022 May 12, 2022

Copy link to clipboard

Copied

This method has been deprecated and replaced by the spawn method of the Template object. You should not use 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
community guidelines
Community Expert ,
May 12, 2022 May 12, 2022

Copy link to clipboard

Copied

Thanks,

What does "superseded" means exactly as this method is still working (such as other superseded methods or properties).

Does that mean it will not work in a next time?

@+

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 12, 2022 May 12, 2022

Copy link to clipboard

Copied

LATEST

Yes, it means that at any point in the future it could stop working.

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

It's all explained in the documentation of that method.

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