iTextSharp HTMLWorker.ParseToList() throws NullReferenceException
问题 I am using iTextSharp v.4 to merge a whole bunch of html files. It was working fine until I needed to upgrade to v.5 of iTextSharp. The problem comes when I pass a streamreader (reading the content of the html file) into the HTMLWorker object's ParseToList method. It throws a null reference exception. On debugging it I can access the streamReader and can confirm that the correct content of the file is read. Here is the code: List<IElement> objects; try { objects = HTMLWorker.ParseToList(new