showing results for - "pdfjs customizing viewer html js event handler"
Valerio
10 Nov 2020
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
Abel
09 Sep 2018
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);