在iframe中显示pdf文件 [英] Display pdf file in iframe
本文介绍了在iframe中显示pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的代码:
My code:
protected void Page_Load(object sender, EventArgs e)
{
myframe.Attributes.Add("src", "/UploadJournal/okay3.pdf");
}
ASP.NET中的代码:
Code in ASP.NET:
<div>
<iframe id="myframe" runat="server"></iframe>
</div>
问题: 当我运行我的程序时,它正在尝试下载of pdf文件但是没有显示在我的页面中。请解决这个问题。
推荐答案
看看这里:
http://stackoverflow.com/a/11603354 [ ^ ]
这取决于浏览器如何显示pdf内容..大多数浏览器不支持显示pdf内联。你需要一个自定义解决方案。
检查这个没有安装在客户端或服务器上的Acrobat Reader的ASP.NET PDF Viewer用户控件 [ ^ ]
It depends on the browser how to display the pdf content... Most browsers do not support to display pdf inline. You need a custom solution.
Check this ASP.NET PDF Viewer User Control Without Acrobat Reader Installed on Client or Server[^]
http://amitpatriwala.wordpress.com/2009/08/28/pdf-viewer -in-asp-net / [ ^ ]
这篇关于在iframe中显示pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文