最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - PDF.js not working on IE9 - Stack Overflow

programmeradmin3浏览0评论

Does anyone have any clue how to get PDF.js to work on IE 9? I have tried everything I can think of to get it to work and no go. I have downloaded the hack.js file and tried adding it before and after pdf.js and before and after viewer.js. That didn't work.

I then tried downloading compatability.js, viewer.js and pdf.js from their Demo (Which I can confirm is working 100% in IE9) and put them into my HTML page, no go. I am using their PDF file, which some sites say that some PDFs work and others don't. So I figured if it worked on their site it must work on mine--but no go.

The Demo of theirs works fine, but anytime I try to get mine to work in IE9, whether I use their files or my compiled version, it doesn't work.

Does anyone have any clue how to get PDF.js to work on IE 9? I have tried everything I can think of to get it to work and no go. I have downloaded the hack.js file and tried adding it before and after pdf.js and before and after viewer.js. That didn't work.

I then tried downloading compatability.js, viewer.js and pdf.js from their Demo (Which I can confirm is working 100% in IE9) and put them into my HTML page, no go. I am using their PDF file, which some sites say that some PDFs work and others don't. So I figured if it worked on their site it must work on mine--but no go.

The Demo of theirs works fine, but anytime I try to get mine to work in IE9, whether I use their files or my compiled version, it doesn't work.

Share Improve this question edited Apr 9, 2013 at 9:47 Zoltan Veres 3555 silver badges27 bronze badges asked Sep 21, 2012 at 20:30 jfreak53jfreak53 2,3497 gold badges38 silver badges55 bronze badges 15
  • 3 Hello - I have gotten this working, using the latest files from GitHub - could you post your code? To this working in IE I did have to remove all the console logging stuff (as IE still doesn't like this....) – Stuart.Sklinar Commented Feb 20, 2013 at 14:26
  • 9 you dont have to remove them, just add a stubby log function to the console object – Less Commented Mar 1, 2013 at 13:38
  • 2 could you please provide link for us to see what is it suppose to do? – happy Commented Mar 14, 2013 at 22:18
  • 2 Problably you have an incompatible doctype, or js errors before running pdf.js. Try to use the same doctype as pdf.js demo page does. Also, make sure IE9 doesn't run in compatibility mode or quirks mode (it could be that your page has some serious HTML anomalies - does the W3C validator complain about anything?). – oxygen Commented Mar 20, 2013 at 19:53
  • 3 Please Create a fiddle and post a link here so we can see the problem in your code. Or post your code directly by editing your post – MarmiK Commented Apr 5, 2013 at 13:25
 |  Show 10 more comments

3 Answers 3

Reset to default 9

Try to load compatibility.js before pdf.js. Something like this:

  <script type="text/javascript" src="/js/compatibility.js"></script>
  <script type="text/javascript" src="/js/pdf_compr.js"></script>

Browser support in their FAQs - check this as since the question was asked IE9 could have be supported: https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#what-browsers-are-supported

PDF.JS and IE9 doesn't play too well together and I wouldn't rely on it if you want to support IE 9. Some of the rendering features in PDF.JS are not well progressed enough to be useable in IE9

There are ways to get around this, you can use FlexPaper which can be used in combination with PDF.js and a HTML4 version for browsers without HTML5 support

http://flexpaper.devaldi.com/demo/

(note; I am affiliated with FlexPaper product)

发布评论

评论列表(0)

  1. 暂无评论