0

I'm wondering if there is something out there where, if I press a button on an asp.net web page, I can programmatically create a pdf of that page and save it to my hard drive.

locoboy
  • 38,002
  • 70
  • 184
  • 260
  • Have a look here (the questions are somewhat similar): http://stackoverflow.com/questions/564650/convert-html-to-pdf-in-net – alex May 14 '11 at 16:58

2 Answers2

1

Please check this HTML to PDF Converter

Generate PDF documents from a HTML page using ASP.NET

Muhammad Akhtar
  • 51,913
  • 37
  • 138
  • 191
1

This is a pretty decent product for it, but I don't think it's free.

Here's an example of how it could be used.

var pdfVision = new SautinSoft.PdfVision();
var pdfBytes = pdfVision.ConvertHtmlFileToPDFStream("http://localhost/default.aspx");

//show PDF            
Response.Buffer = true;
Response.Clear();
Response.ContentType = "application/PDF";
Response.AddHeader("Content-Disposition:", "attachment; filename=Result.pdf");
Response.BinaryWrite(pdfBytes);
Response.Flush();
Response.End();
ataddeini
  • 4,931
  • 26
  • 34