I have a UI Panel called "pnlPerson" which produces the following HTML:
<table width="90%" style="border: 1px black solid">
<tr>
<td style="background-color: dodgerblue; color: white" colspan="12">GARANTİ : </td>
</tr>
</table>
I then want to turn this HTML into a PDF using iText
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);
pnlPerson.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);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();
It creates the PDF, but without inline CSS properties, so the PDF page is split. How can I solve that problem?