This sample uses EO.Pdf for .NET to convert any HTML file to PDF.
Sample code to convert HTML file to PDF (many advanced features not shown here):
//Code to convert a HTML file to PDF. The following code writes output to a file. You can
//also write output to a Stream, a PdfPage, or a PdfDocument object
In addition to convert it to a file, it can also convert it to any .NET Stream object. For example,
you can convert it to a MemoryStream object, then retrieve the raw bytes of the PDF file from the
MemoryStream and attach it to an email, all without creating any physical file at all.
There are many conversion options available. Detailed documentation and sample code about this feature
can be found in the download package.