I have tried the code below, I am also facing an error. I am using latest DLL.
String strSelectUserListBuilder = @"<html><body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>";
String htmlText = strSelectUserListBuilder.ToString();
List<IElement> htmlarraylist = iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(new StringReader(htmlText), null);
I got this error:
The given key was not present in the dictionary.
Try this:
Document document = new Document();
PdfWriter.GetInstance(document, new FileStream(Request.PhysicalApplicationPath + "\\MySamplePDF.pdf", FileMode.Create));
document.Open();
iTextSharp.text.html.simpleparser.HTMLWorker hw =
new iTextSharp.text.html.simpleparser.HTMLWorker(document);
hw.Parse(new StringReader(htmlText));
document.Close();