“PDFJS Customizing Viewer.html JS Event Handler” Code-Antworten

PDFJS Customizing Viewer.html JS Event Handler

<script>
  // add this script block to viewer.html (pdfjs/web/viewer.html)
  document.addEventListener('DOMContentLoaded', function() {
    console.log('DOMContentLoaded');
  }, true);

  document.addEventListener('webviewerloaded', function(e) {
    console.log('webviewerloaded');
  });
</script>
Old Knight

PDFJs fügen dem Viewer.js benutzerdefinierten Ereignishandler hinzu

// 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);
Old Knight

Ähnliche Antworten wie “PDFJS Customizing Viewer.html JS Event Handler”

Fragen ähnlich wie “PDFJS Customizing Viewer.html JS Event Handler”

Weitere verwandte Antworten zu “PDFJS Customizing Viewer.html JS Event Handler” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen