Display Chinese,Japanese Characters in pdf in itextSharp in c#

  • Thread starter Thread starter Connect to Manas
  • Start date Start date
C

Connect to Manas

Guest
Dear Sir,

i have a table with 2 cells .I want to display the chinese character in the table.

But Instead of Chinese character any english character is displaying perfectly.

please help me.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using iTextSharp.text.pdf;
using iTextSharp.text;
using System.IO;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

Document doc = new Document();
PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(Request.PhysicalApplicationPath + "test.pdf", FileMode.Create));
doc.Open();

PdfPTable table = new PdfPTable(2);
PdfPCell cell = null;
cell = new PdfPCell(new Phrase("全澳甲流确诊病例已破"));
cell.BackgroundColor = new Color(192, 192, 192);
table.AddCell(cell);
PdfPCell cell1 = null;
cell1 = new PdfPCell(new Phrase("全澳甲流确诊病例已破"));
cell1.BackgroundColor = new Color(192, 192, 192);
table.AddCell(cell1);
doc.Add(table);
doc.Close();
Response.Redirect("~/test.pdf");

}
}

Continue reading...
 
Back
Top