I am using the webviewer inside a pager (like swiperjs). When the user swipes the individual page I want to fire an event off to let them know that they need to go left or right.
I have managed to create my own event inside toucheventsmanager.js file, however, this only works on mobile device. How can I do the same on desktop, infact I can’t seem to track any scroll event.
if (swipedToRight === true) {
fireEvent(Events.SWIPE_RIGHT);
}
if (swipedToLeft === true) {
fireEvent(Events.SWIPE_LEFT);
}
Thanks, I am looking to find out I can find out where the scroll position is with relation to the page, easy on touch events not so easy it seems on mouse dragging events.
I linked into handleScroll inside DocumentContainer, but it again has no relation to where in the page it is.
After looking at this issue, there’s a few things that might work here.
PDFTron Systems Inc. | Documentation Looking at the guide here, there seems to be a function that is able to convert the window points to coordinates inside the page.
Using the same guide as above, you should be able to use the scrollViewElement in documentViewer to retrieve the exact page coordinates you need. (PDFTron WebViewer Class: DocumentViewer)