Actions on Bookmarks

67 views
Skip to first unread message

Matt Parizeau

unread,
Jul 2, 2014, 4:18:48 PM7/2/14
to
Q:

I've attached an action to a bookmark in the PDF document however when I convert it to XOD the action doesn't seem to work.  Are actions on bookmarks possible in WebViewer?

A:

Currently we only support actions on widgets.  With the current lack of support for bookmark actions it would probably be easier for you to just add a click handler to the bookmark element itself inside the viewer.  For example you could put code like this in a config file (see our WebViewer samples for examples of using config files):

$(document).on('documentLoaded', function() {
    var bookmarks = readerControl.docViewer.GetDocument().GetBookmarks();
    for (var i = 0; i < bookmarks.length; i++) {
        if (bookmarks[i].GetName() === "my bookmark name") {
            $('#bookmark' + i).on('click', function() {
                alert('hello');
            });
            break;
        }
    }
});
Reply all
Reply to author
Forward
0 new messages