Sorry, typo mistake.
NOT
table.addCell(b[i].getChiName()) ;
SHOULD BE
table.addCell(new Phrase(b[i].getChiName(), font)) ;
Thanks again.
Regards,
Tommy Cheng
--- Tommy Cheng <[EMAIL PROTECTED]> wrote:
> Dear Bruno,
>
> Thanks for your kindly help.
> I overwrite the server JRE successfully with 1.4 and
> now I can run the program with itext-1.4.8.jar.
>
> However, I still can't display the Chinese
> characters
> with iTextAsian.jar.
> The Chinese characters displayed in console with
> System.out.println perfectly but still not in PDF.
> Below is the code I write. The first one is that I
> embed our custom font with INDENTITY_H where the
> second one is following the suggestion with
> iTextAsian.jar
>
> Please help to give me some suggestion.
> Thanks a lot!
>
> ------------- Code 1 -------
> Document document = new
> Document(PageSize.A4.rotate())
> ;
>
> String fileName = "./result/test.txt" ;
> PdfWriter.getInstance(document, new
> FileOutputStream(fileName));
>
> document.open() ;
>
> BaseFont bfComic =
> BaseFont.createFont("./HA_Mingliu.ttf",
> BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
> Font font = new Font(bfComic, 12);
>
> PdfPTable table = new PdfPTable(2);
> table.addCell("Ref. No.");
> table.addCell("Chinese Name");
>
> for (int i=0; b!=null && i<b.length; i++) {
> table.addCell(b[i].getCertNo()) ;
> table.addCell(b[i].getChiName()) ;
> }
>
> document.add(table);
>
> document.close() ;
> ------------------------------
>
> -------------- Code 2 -----------------
> Document document = new
> Document(PageSize.A4.rotate())
> ;
>
> String fileName = "./result/test.txt" ;
> PdfWriter.getInstance(document, new
> FileOutputStream(fileName));
>
> document.open() ;
>
> BaseFont bfComic =
> BaseFont.createFont("MSung-Light",
> "UniCNS-UCS2-H", BaseFont.EMBEDDED);
> Font font = new Font(bfComic, 12);
>
> PdfPTable table = new PdfPTable(2);
> table.addCell("Ref. No.");
> table.addCell("Chinese Name");
>
> for (int i=0; b!=null && i<b.length; i++) {
> table.addCell(b[i].getCertNo()) ;
> table.addCell(b[i].getChiName()) ;
> }
>
> document.add(table);
>
> document.close() ;
> -------------------------------
>
>
> Regards,
> Tommy Cheng
>
> --- "Bruno Lowagie (iText)" <[EMAIL PROTECTED]>
> wrote:
>
> > Tommy Cheng wrote:
> > > However, it shows me below exception
> > > --------
> > > Exception in thread "main"
> > > java.lang.UnsupportedClassVersionError:
> > > com/lowagie/text/DocumentException (Unsupported
> > > major.minor version 48.0)
> > > --------
> >
> > You have a version conflict.
> > You probably have different versions of iText in
> > your CLASSPATH, or you
> > are using the JDK1.4 compiled jar in a 1.3 or 1.2
> > environment. In this
> > case, you should download the source code and
> > compile your own jar,
> > taking into account the issues explained in this
> FAQ
> > entry:
> > http://itext.ugent.be/library/question.php?id=19
> > br,
> > Bruno
> >
> > >
>
-------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of
> IT
> > Join SourceForge.net's Techsay panel and you'll
> get
> > the chance to share your
> > opinions on IT & business topics through brief
> > surveys - and earn cash
> >
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>
> _______________________________________________
> > 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/
> >
>
>
>
>
>
>
>
>
_________________________________________________________
>
> 捇誥轎煤G蚘眊ㄜ笢弊菴珨橈拸嶼僵蚘璃玊閉湮蚘眊
> http://cn.mail.yahoo.com/?id=77071
>
>
> >
-------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get
> the chance to share your
> opinions on IT & business topics through brief
> surveys - and earn cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>
_______________________________________________
> 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/
>
_________________________________________________________
捇誥轎煤G蚘眊ㄜ笢弊菴珨橈拸嶼僵蚘璃玊閉湮蚘眊
http://cn.mail.yahoo.com/?id=77071
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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/