Skip to content

Instantly share code, notes, and snippets.

@nelsonsilva
Created January 26, 2016 12:40
Show Gist options
  • Save nelsonsilva/5cc100544c0bdccb87fa to your computer and use it in GitHub Desktop.
Save nelsonsilva/5cc100544c0bdccb87fa to your computer and use it in GitHub Desktop.
<script type="text/js-worker">
<!-- pdf.worker.js content goes here -->
</script>
<script>
var workerSrc = document.querySelector('script[type="text/js-worker"]').textContent
var blob = new Blob([workerSrc], {type: "text/javascript"});
PDFJS.workerSrc = window.URL.createObjectURL(blob);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment