Skip to main content
Participant
July 18, 2019
Question

Script Go to template

  • July 18, 2019
  • 3 replies
  • 412 views

Hello! I need help with a PDF form. I use Acrobat PRO DC. (hope i'm clear, english is not my first language, sorry!)

I have a PDF with a table of contents, and the rest of the pages (i created templates with them) are hidden. When i click on a radio button in the table of contents, only the concerned page shows, but it doesn't go to the page. I want it to go to that page.

I tried with the preset in Acrobat, but it doesn't work. For example, i write to go to page 4, but when the pages hide and then show again, it replaces what i wrote with page 1... I need a javascript that would tell "go to the template "XXXX". Is it possible? Or maybe "go to last page". Can somebody help me? Thanks!

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Bernd Alheit
Community Expert
Community Expert
July 18, 2019

How does you show the pages?

Participant
July 18, 2019

Hi! I created templates with my pages first, and then here is my script to hide and show the the template. I apply this on every radio button in my table of contents :

if(event.target.value!="Off")

{

this.getTemplate("Template1" ).hidden=false;

this.getTemplate("Template2" ).hidden=true;

this.getTemplate("Template3" ).hidden=true;

this.getTemplate("Template4" ).hidden=true;

this.getTemplate("Template5" ).hidden=true;

this.getTemplate("Template6" ).hidden=true;

}

    else

{

this.getTemplate("Template1 ).hidden=true;

this.getTemplate("Template2" ).hidden=true;

this.getTemplate("Template3" ).hidden=true;

this.getTemplate("Template4" ).hidden=true;

this.getTemplate("Template5" ).hidden=true;

this.getTemplate("Template6" ).hidden=true;

}

Bernd Alheit
Community Expert
Community Expert
July 18, 2019

Info: this will not work in Acrobat Reader.