New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failing in Safari #3352
Comments
Can anyone confirm this issue? |
You should include compatibility.js which will disable range request loading for safari. See #3315 |
Hi Brendan, Just tried including compatibility.js per your suggestion, but it's having no effect - still getting Invalid XRef stream error: Warning: Setting up fake worker. |
Make sure you clear the safari cache and restart it. There still may be bad cached requests in there. |
Not a caching issue- we're trying this on multiple safari browsers, some for first time. None are working. We've reproduced the error on Safari versions 5.1.9 - 6.0.4, for OSX 10.6.8 - 10.8.3. The test link is here: http://test.appgrinders.com/pdf_js/test.html |
Looks like we aren't disabling range requests early enough. The code to disable is running after the document is being fetched. |
Let's try 152e376 |
Still failing: http://test.appgrinders.com/pdf_js/test.html Warning: Setting up fake worker. |
I believe the WebKit bug that tracks the range-request issue is: [Mac] XHR range requests are broken (Test failure: http/tests/xmlhttprequest/range-test.html) Comment #4 on that bug notes a workaround: A workaround for this bug is to suppress caching for each XHR with a Range header, using: I would suggest trying that to see if it fixes the issue, rather than disabling range requests altogether for Safari. |
In my testing there were still issues with the cache disabled. |
I've figured out what how to get things working in Safari. The See this answer for some more detail: |
@ykessler, can we close the issue? Does the example work with recent compatibility.js ? |
@yurydelendik- I don't think the compatibility.js changes had an effect either way, though it does work with the latest. As I mentioned above, the keys to finally get things working in Safari was: 1- Including compatibility.js This is no longer an issue for me- can be closed. Thanks- |
Our sample PDF files are failing to load in Safari, whether served locally on MAMP or from our remote test server.
(Using latest pdf.js build (PDFJS.version = '0.8.229'; PDFJS.build = 'b996e1b';) on Safari (5.1.9 - 6.0.4) Mac OSX Snow Leopard + (10.6.8 - 10.8.3))
EXAMPLE:
This is an example of the demo code served from our server with a sample PDF. Works on Chrome/FFox but not Safari:
http://test.appgrinders.com/pdf_js/test.html
Console output:
Warning: Setting up fake worker.
Error: Invalid XRef stream
(while reading XRef): Error: Invalid XRef stream
pdf.js:850undefined
Warning: Indexing all PDF objects
Error: Invalid XRef stream
(while reading XRef): Error: Invalid XRef stream
pdf.js:850undefined
Sample PDFs tested (They were all served from our server):
FAILS IN SAFARI:
http://samplepdf.com/sample.pdf
http://forums.adobe.com/servlet/JiveServlet/previewBody/2041-102-1-2139/Sample.pdf
https://github.com/prawnpdf/prawn/raw/master/data/pdfs/form.pdf
WORKS IN SAFARI: (Only pdf.js's own PDF file actually works)
http://cdn.mozilla.net/pdfjs/helloworld.pdf
(All the tested files load fine in Chrome/FFox/Android)
The text was updated successfully, but these errors were encountered: