Im using stringbuilder creating dynamically html table on codebehind. but when i export html table to pdf, chinese charachter column is blank like that below picture and not include style.
currently my pdf output is :
and html table is :
how can i resolve
and my code is :
- Response.ContentType = "application/pdf";
- Response.AddHeader("content-disposition", "attachment;filename=TestPage.pdf");
- Response.Charset = "UTF-8";
- Response.ContentEncoding = System.Text.Encoding.UTF8;
- 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);
- pdfDoc.Close();
- Response.Write(pdfDoc);
- Response.End();