Pdf.js does not work in Internet Explorer

Can someone explain to me why this code does not work in IE? Everything works fine in Chrome.

Part of my Html:

<head> <script type='text/javascript' src="//code.jquery.com/jquery-1.9.1.js"></script> <script type='text/javascript' src="http://vivin.net/pub/pdfjs/pdf.js"></script> <script type='text/javascript' src="http://vivin.net/pub/pdfjs/textlayerbuilder.js"</script> </head> <body> <div id="pdfContainer" class = "pdf-content"></div> </body> 

Full code and example that works in Chrome: http://jsfiddle.net/vivin/RjqUf/

+7
javascript html html5 internet-explorer
source share
2 answers

I understood what my problem was. I replaced pdf.js with pdf.min.js, and now everything works fine in Explorer 10 as well as in Chrome. I don’t know why, but it works.

+5
source share

the reason it doesn't work is because pdf.js is not supported ie9 and below https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#what-browsers-are-supported

if you want to force users to embed pdf in ie7,8,9 you can do this

 <embed src="../pdfFileName.pdf" class = "pdf-content"> .pdf-content {your style and size} 

this works if they have something from a pdf reader

if you want to return the backup, you can use the <object> there is a discussion about EMBED vs. OBJECT about embedding an object vs

0
source share

All Articles