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

javascript - Pdf.js not working on Internet Explorer - Stack Overflow

programmeradmin1浏览0评论

Can anyone explain me why this code don't work in IE? In Chrome everything works just fine.

Part of my Html:

<head>
<script type='text/javascript' src="//code.jquery/jquery-1.9.1.js"></script>
<script type='text/javascript' src=".js"></script>
<script type='text/javascript' src=".js"</script>
</head>  
<body>
<div id="pdfContainer" class = "pdf-content"></div>
</body>

Full code and example that works on Chrome: /

Can anyone explain me why this code don't work in IE? In Chrome everything works just fine.

Part of my Html:

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

Full code and example that works on Chrome: http://jsfiddle/vivin/RjqUf/

Share Improve this question asked Apr 26, 2014 at 14:09 maxus182maxus182 1611 gold badge1 silver badge10 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

I've figured out what my problem was. I replaced the pdf.js with pdf.min.js and now everything works fine in both Explorer 10 and Chrome. Don't know exactly why, but it works.

the reason it doesnt work is because pdf.js is not supported by ie9 and below https://github./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 somekind of pdf reader

if you want fallback you can use <object> tag there is a discussion EMBED vs. OBJECT about embeding vs object

发布评论

评论列表(0)

  1. 暂无评论