Dear All,
Can I use defined font when I want to export to PDF same adding Paragraph
following below?
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition",
"attachment;filename=myGridView.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
BaseFont EnCodefont =
BaseFont.CreateFont(Server.MapPath("/font/ANGSA.TTF"), BaseFont.IDENTITY_H,
BaseFont.EMBEDDED);
Font Nfont = new Font(EnCodefont, 18, Font.NORMAL);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
myGridView.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
Document pdfDoc = new Document(PageSize.A4, 30, 20, 40, 40);
HTMLWorker htmlworker = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
pdfDoc.Add(new Paragraph("สวัสดี", Nfont)); ß Can Display In Thai
Language.
htmlworker.Parse(sr); ß Can Not Display In Thai Language when pulled
data from gridview to write down pdf.
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();
I think the default front of iTextsharp is HELVETICA. It can support Thai
language.
Can I add defined font in "htmlparser.Parse(sr)" ?
I would appreciate any ideas.
Thank you.
Nattapong S.
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php