I've got an ASP.NET web page that is a dynamically generated report. For business reasons, this exact report needs to be produced as a PDF. What's the best way to do this? Setting the selected printer to Adobe PDF is not an option.
Learn to programmatically create PDFs from scratch? Is there a way to render it in some browser control, then save the ouput?
Here's how to convert a Chrome HTML web page to PDF:Browse to the desired web page. Click the More Options button —three vertical dots on the far-left of the browser's top ribbon. Click on the Print option. Change Destination to Save As PDF.
PDF and HTML are both file formats. For articles, the PDF and HTML files both contain the same text but there are some differences between the two. A PDF shows you what the actual article looks like (almost like a photocopy of it) and will have the actual page numbers that appeared in the article in print.
Chrome has a built-in PDF viewer and can open the PDF files. When Chrome is selected as the PDF viewer, the PDF files will change to Chrome HTML.
wkhtmltopdf - I compiled it in Windows and it works great. It uses WebKit (Safari, Chrome, etc.) to render an HTML page into PDF, and it is free!
If the report is a grid (probably is), this blog post using iTextSharp may help. iTextSharp is good and the most complete PDF API for C# that I've seen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With