c# - 如何在 asp.net 中打开 pdf 到 pdf 查看器

标签 c# asp.net

我有一本pdf书我想在asp.net浏览器的pdf查看器中打开这个pdf “http://wdn.ipublishcentral.net/informatics/viewinside/40590590200230” 你会推荐我吗?

最佳答案

<iframe>标签用于此。

尝试像下面这样使用这个标签:

 <iframe src="anyfilename.PDF" width="810px" height="700px" scrolling="no" frameborder="0">
</iframe>

如果您像您提供的链接一样使用 telerik 控件,请使用以下内容>>

<radPdf:PdfWebControl id="PdfWebControl1" runat="server" height="600px" width="100%" />

和代码隐藏>>

if (!IsPostBack) 
        {
            //Get PDF as byte array from file (or database, browser upload, remote storage, etc)
            byte[] pdfData = System.IO.File.ReadAllBytes(@"C:\demo.pdf");

            //Load PDF byte array into RAD PDF
            this.PdfWebControl1.CreateDocument("Document Name", pdfData);
        }

希望对您有所帮助!!!

关于c# - 如何在 asp.net 中打开 pdf 到 pdf 查看器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15634492/

相关文章:

c# - 保活sql事务

c# - 绑定(bind)到 ResourceDictionary 中的静态主题

c# - 从数据库中提取字符串。说不能隐式转换为 'string'

c# - 如何在asp.net core中添加多个身份和多个角色

c# - 更改页面时如何从下拉列表中保留所选值?

c# - 线程安全共享对象过期和重新初始化

c# - 在 WPF 中设置和删除工具提示

asp.net - 'Microsoft.Jet.OLEDB.4.0' 提供程序未在本地计算机上注册

asp.net - 如何清除 ASP.NET 数据网格?

asp.net - datatextfield 上的多个值