Code to Open PDF File

Lakhangarg
Posted by Lakhangarg under ASP.NET category on | Views : 3337
Code to Open the PDF File
Pass the Physical Path of the PDF File
e.g: c:/lakhan.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();
}

Comments or Responses

Login to post response