Export asp.net page to pdf

  • Thread starter Thread starter sonali_aurangabadkar
  • Start date Start date
Hi Sonali

You have to use some PDF Components freely avaiable on net

or

Use this code

Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition",
"inline;filename=CoBrokerTransfer.pdf");
Response.BinaryWrite(result);
Path=Session["Path"].ToString();
FileStream CreatePdf = new FileStream(FilePath + Path,
FileMode.OpenOrCreate, FileAccess.Write);
CreatePdf.Write(result,0,result.Length);
CreatePdf.Close();

This code I have successfully used in one of my projects and tshi will open
the page in PDF and save the file in Path.

Hope this is usefult to you If you have any questions then please reply back.

Regards
Rehan
 
Back
Top