如何使用Base64显示在Internet Explorer 9 PDF? [英] How to show PDF in Internet Explorer 9 using base64?

查看:796
本文介绍了如何使用Base64显示在Internet Explorer 9 PDF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图显示IE9的PDF文件。我不希望用户知道的任何URL文件信息。所以我编码的PDF文件为Base64和使用标签:

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>

它工作正常使用Chrome和Firefox的最新版本......但不能与IE9。

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

提示?

推荐答案

这是不能直接在此方式 - Internet Explorer不会允许使用数据URI作为帧的源。您的可能的能够使用一个对象标签的PDF阅读器CLSID和数据整个文档的URI,但它是由PDF阅读器,以决定是否支持。

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.

这篇关于如何使用Base64显示在Internet Explorer 9 PDF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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