在 IE9+ 上显示 base64 pdf 的解决方法 [英] Workaround of showing a base64 pdf on IE9+
问题描述
我想将 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屋!