I am using itextsharp version 5.5.13.2
I am trying the solution in How to display chinese characters in pdf file created with iTextSharp but it did not work it is not displaying anything. my document is blank.
FontSelector selector = new FontSelector();
selector.AddFont(FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12));
selector.AddFont(FontFactory.GetFont("MSung-Light", "UniCNS-UCS2-H", BaseFont.NOT_EMBEDDED));
Phrase ph = selector.Process("全澳甲流确诊病例已破");
document.Add(new Paragraph(ph));
I am trying to find a solution
I also tried the solution below but it errors b/se the AddToResourceSearch method is not available.
public iTextSharp.text.Font CreateChineseFont()
{
BaseFont.AddToResourceSearch("iTextAsian.dll");
BaseFont.AddToResourceSearch("iTextAsianCmaps.dll"); //"STSong-Light", "UniGB-UCS2-H",
BaseFont baseFT=BaseFont.CreateFont("STSong-Light", "UniGB-UCS2-H", BaseFont.EMBEDDED);
iTextSharp.text.Font font = new iTextSharp.text.Font(baseFT);
return font;
}
Document document = new Document(PageSize.A4,50, 50, 50, 50);
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream("Chap11.pdf", FileMode.Create));
document.Open();
iTextSharp.text.Font font = CreateChineseFont();
document.Add(new Paragraph("全澳甲流确诊病例已破", font));
document.Close();