I have problem with polish character using itextSharp. I want to create pdf from html. Everything works fine but polish character are missing. I use function lower:
I GOT THE ANSWER! =) (specifically targeted for polish) I feel obligated to put it here in this old thread, since i'm sure I wont be the last to find it.
I'm severely disappointed that there aren't any good answers to this... most of them suggest using the ARIALUNI.TTF in your Windows FONTS folder which results in your PDF file being MANY times bigger. The solution doesn't need to be so drastic...
Many others suggest examples showing encoding with cp1252 which fails on Arial and doesn't work with Helvetica for Polish text.
I'm using iTextSharp 4.1.6... the trick is... cp1257! And you can use it with BaseFont.Courier, BaseFont.Helvetica, BaseFont.Times-Roman
This works... and my PDF files are tiny (3kb!)
document.Open();
var bigFont = FontFactory.GetFont(BaseFont.COURIER, BaseFont.CP1257, 18, Font.BOLD);
var para = new Paragraph("Oryginał", bigFont);
document.Add(pgDocType);
document.Close();
I will test later and make sure I can open and read these in Windows XP and Mac OSX in addition to Windows 7.