Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unexpected server response (0) while retrieving PDF

3,852 views
Skip to first unread message

pierre.a

unread,
May 27, 2013, 5:27:55 AM5/27/13
to
Hello,

I'm a new user of pdf.js. Well not yet in fact because I'm experiencing problems when loading a pdf.
Setup went fine, and I wrote the following line in my webpage:

<iframe width="100%" height="700px;" src="../pdfjs/web/viewer.html"></iframe>

The viewer displays ok, but I keep having the following message:

Message : Unexpected server response (0) while retrieving PDF "file:///'myhome'/'mywebsite'/pdfjs/web/compressed.tracemonkey-pldi-09.pdf".

and of course no pdf appearing in the viewer.

I checked on the web but got no clue. If someone can help me, would be great !
Thanks

Brendan Dahl

unread,
Jul 10, 2013, 8:35:32 PM7/10/13
to pierre.a, dev-p...@lists.mozilla.org
The page likely doesn't have permission to read local files. Try hosting it on the server where you are hosting the js files.

Brendan
> _______________________________________________
> dev-pdf-js mailing list
> dev-p...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-pdf-js

Rob Wu

unread,
Jul 11, 2013, 6:58:27 AM7/11/13
to
If you want to test your website locally, you need to set up a local server, e.g. using `python -m SimpleHTTPServer`. If you're using Chrome, run `chromium --disable-web-security` (replace `chromium` with the actual name of your executable). This action disables the Same origin policy, so be careful to only use this for development purposes, and not for general browsing.
0 new messages