如何使用C#在网站页面加载PDF文件
最佳答案
以下是将文件发送到浏览器的方法。
http://support.microsoft.com/kb/306654
private void Page_Load(object sender, System.EventArgs e)
{
//Set the appropriate ContentType.
Response.ContentType = "Application/pdf";
//Get the physical path to the file.
string FilePath = MapPath("acrobat.pdf");
//Write the file directly to the HTTP content output stream.
Response.WriteFile(FilePath);
Response.End();
}
关于c# - 如何使用C#在网站页面加载PDF文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2631084/