【发布时间】:2015-10-19 10:28:48
【问题描述】:
我刚刚在我的网站上切换到 HTTPS。我一直在通过 iframe 显示本地托管的 PDF; iframe 显示一个小的 html 文件,其中嵌入了 PDF(作为对象)。但是,PDF 不再显示。我可以导航到 PDF,它显示得很好,但在我加载 html 页面时不显示。如何使 PDF 显示?
iframe
<iframe src="/updates/update.htm" width="100%" height="800px"
marginheight="0" frameborder="0"></iframe>
update.htm
<html>
<header>
<link rel="stylesheet" href="custom-styles.css">
</style>
</header>
<body>
<object src="update.pdf"
type="application/pdf" width="100%" height="800px"><div id="show-text">
<p>It appears your web browser is not configured to display PDF files.</p>
<p><a href='update.pdf'>Click here to download the PDF file.</a></p>
</div>
</object>
</body>
</html>
自定义样式.css
#show-text {
display: block;
width: 100%;
height: 15%;
background: #D1D1D1;
}
【问题讨论】: