要在网页中打开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/