Error:
Unable to cast object of type 'iTextSharp.text.List' to type 'iTextSharp.text.Paragraph'.

c# Code:
  1. StringReader SR = new StringReader(strText);
  2.        
  3.         List<IElement> HTML_List = HTMLWorker.ParseToList(SR, null);
  4.  
  5.         for (int k = 0; k < HTML_List.Count; k++)
  6.         {
  7.             doc.Add((IElement)HTML_List[k]);
  8.         }
  9.  
  10.         doc.Close();
  11.     }

the value in strTest:
html Code:
  1. "\r\n\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n\t<title>\r\n    Convert html to pdf using iTextSharp\r\n : The Official Microsoft ASP.NET Forums</title>\r\n\t<meta content=\"text/html; charset=UTF-8\" http-equiv=\"Content-Type\" />\r\n    \r\n\t<link href=\"http://i3.asp.net/common/www-css/i/favicon.ico?cdn_id=20110616-003\" rel=\"shortcut icon\" />    \r\n    <link href=\"http://i1.asp.net/fan-cheetah/style/prod-site.min.css?cdn_id=20110616-003\" rel=\"Stylesheet\" type=\"text/css\" media=\"screen\" />\r\n    <!--[if lte IE 7]>\r\n    <link href=\"http://i1.asp.net/fan-cheetah/style/prod-lt ..... The list goes on