views:

58

answers:

1

Hi All,

I am having hard time trying to generate PDF files containing Greek letters using itextpdf. I am reading the strings from an external source as UTF-8 strings. English letters appear in results but not the Greek ones. Searching for the problem, I think it might be related to the font used. I do not know what ttf file to use if this is the problem. Here is how am creating the font

BaseFont bfTimes = BaseFont.createFont(FontFactory.HELVETICA,"UTF-8", BaseFont.EMBEDDED); Font times = new Font(bfTimes, 12, Font.BOLD);

any help is heartily appreciated!

+1  A: 

You need to use a font that has Greek characters in it. You may find Greek unicode fonts here.

You can check an example here on using unicode fonts from the author of itext.

rics
the example you pointed to is extremely helpful. I ended up using arialuni.ttl and it works. Thanks a lot!
fadmaa