Does Pdf.js Only Work With Certain Pdfs?
Solution 1:
It is supposed to work with all pdf files, unless they are corrupted. The error you have here is:
XMLHttpRequest cannot load http://infolab.stanford.edu/pub/papers/google.pdf. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://fiddle.jshell.net' is therefore not allowed access.
In other words, you can't load it this way because http://infolab.stanford.edu/pub/papers/google.pdf
doesn't let you do to so. When you will have it on your server and load it with proper response headers, it will most probably work.
For more information about this error, refer to Why am I seeing an "origin is not allowed by Access-Control-Allow-Origin" error here?
If you don't host these files, you can pipe them through a proxy (which can be a third-party app or your server). For example, Ivan Žužak, developed urlreq
–a tool which does exactly what we need in this situation.
Instead of using the direct link to pdf file, use Ivan's proxy url:
http://urlreq.appspot.com/req?method=GET&url=http%3A%2F%2Finfolab.stanford.edu%2Fpub%2Fpapers%2Fgoogle.pdf
Post a Comment for "Does Pdf.js Only Work With Certain Pdfs?"