Closed SPlatten closed 7 years ago
When trying this: https://mozilla.github.io/pdf.js/web/viewer.html With Safari online it works fine, but the offline demo:
What about chrome?
file://svr/pdfjs/web/viewer.html Does not ?
Maybe but not sure, this seems to be a problem of file://
protocol, some browsers does not allow to access local files using xhr due to security reasons. Basically it violates Access-Control-Allow-Origin
.
Thank you, that makes sense.
As mentioned in the README, see https://github.com/mozilla/pdf.js#getting-the-code, not all browsers support file://
URLs. The solution is to use a web server; closing as answered.
I've downloaded pdf.js tonight with a view to using it for a project. I tried the viewer.html with Safari and whist the viewer loads, the PDF did not. I then tried it with Firefox and it all works perfectly.
It doesn't work in chrome either. Is there any intent to get this working with all the major web-browsers ?
When trying this:
https://mozilla.github.io/pdf.js/web/viewer.html
With Safari online it works fine, but the offline demo:
file://svr/pdfjs/web/viewer.html
Does not ?