Getting the page that a clicked link was on

38 views
Skip to first unread message

Matt Parizeau

unread,
Sep 28, 2017, 4:18:46 PM9/28/17
to PDFTron WebViewer
Q:

When a user clicks a link we'd like to know what page that link was on so that we can allow the user to navigate directly back to that page. Is that possible?

A:

You can add the following code to a config file:

var origOnTrigger = window.Actions.GoTo.prototype.onTriggered;
window
.Actions.GoTo.prototype.onTriggered = function(link) {
  origOnTrigger
.apply(this, arguments);
  console
.log(link.PageNumber);
};

Reply all
Reply to author
Forward
0 new messages