1) I’m currently working with the ‘textSelected’ event and can’t determine how I can know what page in the document the text is being selected on. It’s very common for more than one page to be visible so ‘currentpage’ is not a valid variable to check. How can I go about getting this from the event?
2) I was also wondering how to prevent multiple pages from being selected. I noticed your demo prevents the user from moving the highlight action to two pages (https://www.pdftron.com/webviewer/demo/samples/universal/) How can I mimic this restriction without using the highlight tool?
A:
var oldTextSelected = Tools.TextSelectTool.prototype.textSelected;
Tools.TextSelectTool.prototype.textSelected = function(pageIndex, quads, text) {
// put your custom code here
oldTextSelected.apply(this, arguments);
};