pdfjs add custom event handler to viewer js

Solutions on MaxInterview for pdfjs add custom event handler to viewer js by the best coders in the world

showing results for - "pdfjs add custom event handler to viewer js"
Shawn
22 Jan 2019
1<script>
2  // add this script block to viewer.html (pdfjs/web/viewer.html)
3  document.addEventListener('DOMContentLoaded', function() {
4    console.log('DOMContentLoaded');
5  }, true);
6
7  document.addEventListener('webviewerloaded', function(e) {
8    console.log('webviewerloaded');
9  });
10</script>
11
Pablo
20 Jun 2020
1// you can put anywhere in viewer.js (pdfjs/web/viewer.js) and listens to it
2const event = document.createEvent("CustomEvent");
3event.initCustomEvent("your_new_event", true, true, {});
4document.dispatchEvent(event);