I'm sending emails that have invoices attached as PDFs. I'm already – elsewhere in the application – creating the invoices in an .aspx page. I'd like to use Server.Execute to return the output HTML and generate a PDF from that. Otherwise, I'd have to use a reporting tool to "draw" the invoice on a PDF. That blows for lots of reasons, not the least of which is that I'd have to update both the .aspx page and the report for every minor change. What to do…
C# – Generate PDF from ASP.NET from raw HTML/CSS content
asp.netchtmlpdf
Best Answer
There is no way to generate a PDF from an HTML string directly within .NET, but there are number of third party controls that work well.
I've had success with this one: http://www.html-to-pdf.net and this: http://www.htmltopdfasp.net
The important questions to ask are:
There are a few others but they deal with ActiveX displays and such.