【发布时间】:2014-03-02 05:38:43
【问题描述】:
我已经在我的页面上嵌入了 PDF,使用“<iFrame>”我正在调用一个包含 <Object> 标记的 HTML 页面,其中有一个嵌入 PDF 的 <embed> 标记和一个
标签在没有安装 Adobe Reader 时显示。
在 Firefox、Chrome 和 IE 11 上,如果安装了 PDF 阅读器,它将仅显示 PDF,但当没有安装阅读器时,它会在 <p> 标签中显示消息“安装Adobe 阅读器”。
我的问题是:- 在 IE10 中,即使安装了 Adobe 阅读器,它也会在 <p> 标签中显示消息“安装 Adobe 阅读器”。 如果安装了 Adobe Reader,请建议如何隐藏该消息,并且该消息应仅在未安装 PDF Reader 时显示。
这是我的代码:
Iframe 代码从中调用 PDF 页面:
<div id="pdf">
<iframe id="pdfIframe" name="pdfIframe" src="pdfView.html" style="width: 100%; height: 100%;" scrolling="auto" frameborder="1">
Your browser doesn't support inline frames.
</iframe>
</div>
PDF页面代码:
<body>
<style>
html, body, #blankPane {
height: 100%;
margin: 0;
padding: 0;
}
#blankPane p {
font-weight: bold;
line-height: 30px;
height: auto;
width: 98%;
margin: 0 auto;
color: #bc0000;
}
#blankPane * {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
<div id="blankPane" class="overflowHidden">
<object data="lorem.pdf" type="application/pdf">
<p>
It appears you don't have Adobe Reader or PDF support in this web browser.
<br />
<a href="lorem.pdf">Click here to download the PDF</a> OR <a href="http://get.adobe.com/reader/" target="_blank">Click here to install Adobe Reader</a>
</p>
<embed id="pdfDocument" src="lorem.pdf" type="application/pdf" />
</object>
</div>
请推荐!!!
【问题讨论】:
-
这是您的浏览器,在 IE10 中您必须转到 Internet Explorer > 工具(或 Alt + t)> 管理加载项(显示:所有加载项)验证Shockwave Flash 对象已启用,否则它会告诉您它尚未安装,并且您无法使用纯客户端代码来避免这种情况。
-
在 MVC 的帮助下我能管理什么?
标签: javascript jquery html pdf internet-explorer-10