Friday, May 22, 2009

Open PDF File

//Code to Open the PDF File
Pass the Physical Path of the PDF File
e.g: c:/xyz.pdf

private void ShowPdf(string strS)
{
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition","attachment; filename=" + strS);
Response.TransmitFile(strS);
Response.End();
//Response.WriteFile(strS);
Response.Flush();
Response.Clear();
}

No comments:

Post a Comment