Let's break the problem in simpler pieces. Can you see the characters in the JPanel (pretend that iText doesn't exist)? If you can, everything is well installed in Linux, if you can't you'll have to tell Java where to find the fonts and that's outside the scope of iText.
Assuming that the problem above was solved or never existed, you'll have to register the fonts in DefaultFontMapper and make sure that the names match. Of course, if you used PdfContentByte.createGraphicsShapes() you won't need to register any font as the font outlines will be drawn. I'm curious about what code you used in Windows as just adding a font in windows/fonts is not enough for iText. Paulo ----- Original Message ----- From: "Abhishek Vaidya" <[EMAIL PROTECTED]> To: "Post all your questions about iText here" <[email protected]> Sent: Wednesday, April 25, 2007 12:08 PM Subject: Re: [iText-questions] query regarding japanese fonts not appearingin the PDF > Hi, > > The version of registerDirectories() on my machine is same as you have > mentioned below. I tried registering one of my own directories too by > using the API > public int registerDirectory(String dir) > > Even this didn't work. Otherwise also I am calling > registerDirectories() method which should register the below list of > directories. But even adding Unicode fonts to these directories didn't > work. I think it's a pure configuration issue (no problem with the code > as its working fine on windows). > > Is it related to the .properties files in JRE/lib that map java fonts to > physical fonts? Or is it anything about registering the fonts with the > JVM? > > Abhishek > > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Peter B. West > Sent: Wednesday, April 25, 2007 2:48 AM > To: Post all your questions about iText here > Subject: Re: [iText-questions] query regarding japanese fonts not > appearing in the PDF > > Peter B. West wrote: >> Abhishek Vaidya wrote: >>> Hi, >>> >>> I am using cold fusion for web capture (converting websites to > PDF). >>> It uses Ice Browser to capture the web page as a java.awt panel which > is >>> converted to PDF using itext. Our product is supported on windows and >>> unixes. On windows the code is working fine and displaying the > Japanese >>> characters for websites (I tried http://www.google.co.jp >>> <http://www.google.co.jp/> ). Earlier I was facing problem on windows >>> about Japanese fonts not appearing in the PDF created using itext. >>> Then I figured out that the font Arial Unicode MS (true type) is > requited >>> under c:\windows\fonts (or other Unicode fonts would even do. They > were >>> somehow missing on my machine). When I added this font everything is >> working >>> fine. But when I run the same code on linux red hat the Japanese > characters >>> are not appearing. The itext.jar contains a class FontFactory which > has a >>> method registerDirectories() which registers a few directories > containing >>> fonts with itext for windows and unixes. >>> >>> >>> >>> 1)I added the Arial Unicode MS (true type) (from windows) to a couple > of >>> directories which are used in this method (like >> /usr/X11R6/lib/X11/fonts/TTF >>> and /usr/X11R6/lib/X11/fonts/truetype) but itext did not pick up the >> fonts. >> >> I don't know which version of the code you are running, but the > current >> CVS code of registerDirectories() looks like this >> >> /** Register fonts in some probable directories. It usually works > in >> Windows, >> * Linux and Solaris. >> * @return the number of fonts registered >> */ >> public int registerDirectories() { >> int count = 0; >> count += registerDirectory("c:/windows/fonts"); >> count += registerDirectory("c:/winnt/fonts"); >> count += registerDirectory("d:/windows/fonts"); >> count += registerDirectory("d:/winnt/fonts"); >> count += registerDirectory("/usr/X/lib/X11/fonts/TrueType"); >> count += > registerDirectory("/usr/openwin/lib/X11/fonts/TrueType"); >> count += > registerDirectory("/usr/share/fonts/default/TrueType"); >> count += registerDirectory("/usr/X11R6/lib/X11/fonts/ttf"); >> count += registerDirectory("/Library/Fonts"); >> count += registerDirectory("/System/Library/Fonts"); >> return count; >> } >> >> >> Note that /usr/X/lib/X11/fonts/TrueType will generally require a link >> from /usr/X11R6 to /usr/X. In my experience, the link, when it is >> present, is from /usr/X11R6 to /usr/X11, but I don't know what > Solaris, >> for example, does. These directories won't work for me (SuSE 10.2), > but >> you can always use >> >> /** Register all the fonts in a directory. >> * @param dir the directory >> * @return the number of fonts registered >> */ >> public int registerDirectory(String dir) >> >> Have you tried it? >> > > The code quoted is from com.lowagie.text.FontFactoryImp.java. > >> >> Peter ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
