Convert HTML+css to PDF with Itextsharp in Asp.net C# When file is save at location all the css for the pdf file get lost.
After converting file to pdf all the css is lost for the file If there is any tool please let me know
private void savepdf(System.Web.UI.HtmlControls.HtmlControl control)
{
string destifilepath = @"D:\test\";
string filename = "test.pdf";
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
control.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
Document pdfDoc = new Document(PageSize.A4); //, 10f, 10f, 10f, 0f
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, new FileStream(destifilepath + "\\" + filename, FileMode.Create));
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
}