It looks like you are hitting this problem when using the file:
protocol rather than http:
or https:
. There are different security considerations in play between the different protocols.
Here's a blog post about using XMLHttpRequest
with local files, and a discussion on a Mozilla Firefox ticket.
There are a few tickets (including this one and this one) on the project that may provide pointers. A comment from this ticket says:
Typical pdf.js use cases requires to use a web server and modern HTML5 browser.
I suggest to fix your problem you just run this through a web server to use the http
protocol. Nginx and Apache are easy to install and set up.
If that doesn't work generate pdf.js and pdf.worker.js for your system using this if the above step doesn't work.