Download the dll from here:
http://www.sautinsoft.com/
void htmlToPDF()
{
SautinSoft.PdfMetamorphosis p = new SautinSoft.PdfMetamorphosis();
if (p != null)
{
p.PageStyle.PageOrientation.Landscape();
p.TextStyle.Header = @"Sample header";
p.PageStyle.PageNumFormat = "Page {page} of {numpages}";
string htmlURL = @"http://www.sautinsoft.com/help/html-to-rtf/net/help/htmlsamples/sample1.htm";
string pdfFile = @"d:\test.pdf";
int result = p.HtmlToPdfConvertFile(htmlURL, pdfFile);
if (result == 0)
{
System.Console.WriteLine("Converted successfully!");
System.Diagnostics.Process.Start(pdfFile);
}
else
System.Console.WriteLine("Converting Error!");
}
}
For iTextSharp :
http://blog.dmbcllc.com/2009/07/28/itextsharp-html-to-pdf-parsing-html/