Gmane
Favicon Gravatar
From: bruno <bruno <at> lowagie.com>
Subject: Re: How to create PDF documents with greek characters
Newsgroups: gmane.comp.java.lib.itext.general
Date: 2006-09-08 08:26:26 GMT (2 years, 42 weeks, 5 days, 16 hours and 59 minutes ago)
????????S ????G?O??S wrote:

> Hi everybody,
> I am trying to create a PDF document using the following command
> Paragraph p = new Paragraph("Greek Words",
> FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, new 
> Color(0, 0, 255)));
> and I am getting ???? instead of greek characters into the document.
>  
> Is it possible to insert greek fonts in the itext library

Yes, but not with Helvetica.
Mark already gave you the tip to look at the tutorial chapters about Fonts.
They already give you some ideas, but they aren't exactly well written.
In the book on iText, I've spent two chapters on fonts and you get a much
better overview in the book than in the tutorial.
Unfortunately the book won't be available till November, so I just give you
a preview of one sample:
http://itext.ugent.be/itext-in-action/examples/chapter08/TrueTypeFontEncoding.java
http://itext.ugent.be/itext-in-action/examples/chapter08/results/ttf_encoding.pdf

In short: you need a font that has Greek characters (not Helvetica)
and use Cp1253 as encoding (for the font as well as for your String 
objects).

br,
Bruno

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642