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

Please help with custom javascript button: New Form page from template needs to redirect to new page

Explorer ,
Nov 10, 2020 Nov 10, 2020

Copy link to clipboard

Copied

This script works almost perfect:

 

var pageCount = 0;
var pagePos = 0;
pageCount = this.numPages;
pagePos = pageCount+1;
var b = getTemplate("EVC");
b.spawn({nPage: pagePos, bRename: true, bOverlay: false});

 

I have one issue with this. How to do get the page view to jump to the newly generated page when this same button is clicked? Currently the page view is staying on the same page and then I have to scroll to the next page, so I can't tell if the new page is generated unless I'm watching the page numbers change.

TOPICS
Acrobat SDK and JavaScript

Views

84

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

LEGEND , Nov 10, 2020 Nov 10, 2020

You could set the pageNum property to the newly generated page, which should be the same as pageCount. So you could add the following line of code to the end of your script:

 

pageNum = pageCount;

Likes

Translate

Translate
LEGEND ,
Nov 10, 2020 Nov 10, 2020

Copy link to clipboard

Copied

LATEST

You could set the pageNum property to the newly generated page, which should be the same as pageCount. So you could add the following line of code to the end of your script:

 

pageNum = pageCount;

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