在网页中引入PDF

来源:互联网 发布:检测网络丢包率工具 编辑:程序博客网 时间:2024/05/16 20:30

要在网页中打开PDF文件输出:

protect void Page_Load(object sender, EventArgs e)  {      Response.ContentType = "Application/pdf" ;      string FilePath = Server.MapPath("pdfName") ;      Response.WriteFile(FilePath);      Response.End();  }  


 

若要自己根据内容生成PDF,则用第三方组件iTextSharp。

http://sourceforge.net/projects/itextsharp/

原创粉丝点击