How to show PDF in Internet Explorer 9 using base64?

雨燕双飞 提交于 2019-12-06 16:15:07

问题


I am trying to show a PDF in IE9. I don't want the user to know any URL file info. So I am encoding the PDF file into BASE64 and use the tag:

<iframe src="data:application/pdf;base64,JVBER..." width="500" height="500"></iframe>

It works fine using the latest versions of Chrome and Firefox... but not with IE9.

Tips?


回答1:


This is not directly possible in this way-- Internet Explorer does not permit use of DATA URIs as the source of frames. You may be able to use an OBJECT tag with the PDF Reader CLSID and a DATA URI of the entire document, but it's up to the PDF reader to decide whether they support that.

It's not really clear what you hope to accomplish here, though, since a user can reconstitute the original document from the source if they want to do so.



来源:https://stackoverflow.com/questions/7819366/how-to-show-pdf-in-internet-explorer-9-using-base64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!