pdfjs add custom event handler to viewer.js code example
Example: pdfjs add custom event handler to viewer.js
// you can put anywhere in viewer.js (pdfjs/web/viewer.js) and listens to it
const event = document.createEvent("CustomEvent");
event.initCustomEvent("your_new_event", true, true, {});
document.dispatchEvent(event);