在 IE9+ 上显示 base64 pdf 的解决方法 [英] Workaround of showing a base64 pdf on IE9+

查看:56
本文介绍了在 IE9+ 上显示 base64 pdf 的解决方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 PDF 转换为 base64 并在浏览器上显示.

I would like to convert a PDF to base64 and show on browser.

问题是,以下代码适用于 Firefox 和 Chrome

The problem is , the following code works for Firefox and Chrome

<iframe src="data:application/pdf;base64,encodeString></iframe>

但不是在 IE 9 + 中,假设用户正在使用 adobe reader 插件,是否有任何 jquery 插件/解决方法允许在 iframe 上嵌入 base64 pdf?谢谢

But not in IE 9 + , suppose the user is using adobe reader plugin, are there any jquery plugin/workaround that allow embed a base64 pdf on iframe? thanks

推荐答案

您已经注意到,Internet Explorer 不支持使用 DATA URI 作为 IFRAME 的来源.唯一的解决方法是从 HTTP/HTTPS 或 FTP URI 返回您的 PDF 内容,并将其用作 IFRAME 的来源.

As you've noticed, Internet Explorer does not support the use of DATA URIs as the source of IFRAMEs. The only workaround for this is to return your PDF content from a HTTP/HTTPS or FTP URI and use that as the source of the IFRAME.

这篇关于在 IE9+ 上显示 base64 pdf 的解决方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆