在asp.net中显示PDF的方法:

一、直接显示,使用的还是原页面的URL
Response.ContentType = "application/pdf";

Response.Clear();

Response.TransmitFile(@"SharePoint.pdf");

Response.End();

 

二、以PDF文件做为URL进行显示

Response.Redirect("Sharepoint.pdf");

三、点击进行下载
Response.ClearHeaders();

Response.ContentType = "application/pdf";

Response.Clear();

Response.AppendHeader("Content-Disposition", "attachment;Filename=SharePoint.pdf");

Response.TransmitFile(@"SharePoint.pdf");

Response.End();

 

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2021-12-28
猜你喜欢
  • 2021-10-06
  • 2021-11-18
  • 2022-01-16
  • 2021-11-28
  • 2022-12-23
  • 2021-11-13
  • 2021-05-15
相关资源
相似解决方案