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, General troubleshooting, How to, PDF forms

Views

66

Likes

translate

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

Adobe Community Professional , 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

Translate
Adobe Community Professional ,
Nov 10, 2020 Nov 10, 2020

Copy link to clipboard

Copied

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

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