Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

Re: [iText-questions] How to create PDF documents with greek
 characters

Bruno

2006-09-08

Replies:

????????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
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
©2008 junlu.com - Jax Systems, LLC, U.S.A.