title: how to convert html page to pdf with css using itextsharp?
body: <p>This is my code : </p>
  
  <pre><code>Response.ContentType = "application/pdf";
  Response.AddHeader("content-disposition", "attachment;filename=TestPage.pdf");
  Response.Cache.SetCacheability(HttpCacheability.NoCache);
  
  StringWriter sw = new StringWriter();
  HtmlTextWriter hw = new HtmlTextWriter(sw);
  
  this.Page.RenderControl(hw);
  
  StringReader sr = new StringReader(sw.ToString());
  
  Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0f);
  
  HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
  
  PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
  
  pdfDoc.Open();
  
  **htmlparser.Parse(sr);** //the exception here
  
  pdfDoc.Close();
  Response.Write(pdfDoc);
  Response.End();
  </code></pre>
  
  <p>the error is : </p>
  
  <blockquote>
    <p>Unable to cast object of type 'iTextSharp.text.html.simpleparser.CellWrapper' to type
    'iTextSharp.text.Paragraph'. </p>
  </blockquote>
  
  <p>What is this exception ?</p>