I am working on migrating from WebViewer v7.x to WebViewer 8.x. Most of my code is working, but the code I had that trapped pageChanged events no longer gets called. Could you please provide some updated information on how to trap the pageChanged event with WebViewer 8.x?
instance.Core.documentViewer.addEventListener('pageNumberUpdated', (pageNumber) => {
console.log(`Changed to page ${pageNumber}`)
});
Please let me know if that works for you. If it doesn’t, please provide sample code for what you were doing before in version 7.X and maybe some context on what you were doing (in case there is a bug in 8.0 that only affect some situation). Thank you
Best Regards
Andrew Yip
Software Developer
PDFTron Systems, Inc.
The “pageChanged” event was deprecated a few versions back. It was used in our old UI (version 1 to 3, I believe), before we started using Redact for our UI. For version 4, we deprecated it and stopped using it in the UI part of our codebase (I think we removed it from our guides). We kept the “pageChanged” event in our codebase for a few versions for backward compatibility. In version 8.0, we finally removed that event from our codebase but didn’t include it in our migration guide since it been deprecated for a few version and hadn’t been in any of our guides for a while
In the future we’ll try to include information about us removing deprecated code since that would be breaking change for the users still using them.
Best Regards
Andrew Yip
Software Developer
PDFTron Systems, Inc.