How to jump to the named destination
Below is the code to set the URL on the created link, using javascript in pdf.
var link = this.addLink(pgNum, rect);
link.setAction("this.getURL('https://www.google.com', false)");
I could not find the way to define Hyperlink destinations in pdf using javascript, so I created Hyperlink destinations in inDesign.
Now, how do I setAction on already defined Hyperlink destinations in pdf, so that when clicked on a link it will jump to that Destination.
What do I pass in the setAction() argument ?
// Specify the named destination you defined in InDesign
var namedDestination = "A1#"
// Set the action for the link annotation to jump to the named destination
linkAnnot.setAction("this.getURL('javascript:app.doc.gotoNamedDest(\"" + namedDestination + "\")', true);");
link.setAction("this.gotoNamedDest('" + namedDestination + "');");
Above both options not working.
Please help.
