This will do it, just add the reference to iTextSharp and modify the folder path as required
Code:
public void GeneratePDFDoc(string htmlText)
{
Document doc = new Document(PageSize.A4, 50, 50, 50, 50);
PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(Server.MapPath("FOLDERPATH").Trim()) +"/" +"FileName.pdf", FileMode.OpenOrCreate));
doc.AddDocListener(writer);
doc.Open();
// step 4: we Add some content
//make an arraylist ....with STRINGREADER since its no IO reading file...
List<IElement> htmlarraylist = iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(new StringReader(htmlText),null);
//add the collection to the document
for (int k = 0; k < htmlarraylist.Count; k++)
{
doc.Add((IElement)htmlarraylist[k]);
}
doc.Close();
}