在asp.net页面中显示pdf [英] showing pdf in asp.net page

查看:325
本文介绍了在asp.net页面中显示pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人

我想问一下如何在asp.net页面中显示pdf文件

我已经将pdf文件上传到我的服务器,我具有pdf文件的链接,但是如何查看pdf文件,因此它会像图像一样显示..

问候
galih

Dear All

i want to ask about how to show a pdf file in asp.net page

i have upload a pdf file to my server, i have the link to the pdf file but how to see the pdf file so it''s will show like image..

regards
galih

推荐答案

尝试使用此URL ........................
Try this URL.....................ASP.NET PDF Viewer User Control Without Acrobat Reader Installed on Client or Server[^]


您可以在图像中显示pdf文件
You can show pdf file in image
private void ReadPdfFile()
    {
        string path = @"c:\test.pdf";
        WebClient client = new WebClient();
        Byte[] buffer =  client.DownloadData(path);

        if (buffer != null)
        {
            Response.ContentType = "application/pdf";
            Response.AddHeader("content-length",buffer.Length.ToString());
            Response.BinaryWrite(buffer);
        }

    }




您可以在页面中添加iFrame,并且该iFrame的URL将成为您的PDF文件位置.这样您就可以轻松显示PDF.

谢谢
-amit.
Hi,

you can add iFrame in your page and URL of that iFrame will be your PDF file location. that way you can display PDF easily.

thanks
-amit.


这篇关于在asp.net页面中显示pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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