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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top