com.itextpdf.text.DocumentException: Font 'STSong-Light' with 'UniGB-UCS2-H' is

 

  http://itext-general.2136553.n4.nabble.com/Asian-font-not-recognized-after-update-td2991134.html

 

  我们使用国语的时候,将要把加入亚洲语言的一个包,而这个包只支持到2.X,后续版本的升级中,

  这个包名变掉了,因而需要我们寻找到新的包进行添加到应用中。

 

 

 

 

com.itextpdf.text.DocumentException: Font 'STSong-Light' with 'UniGB-UCS2-H' is not recognized.

 

 

 

Hi all, 

I just recently updated the iText.jar for my program from iText 2.1.7 to iText 5.0.4. There had been quite some changes and one of them is bothering me right now and I can't figure out why. I used to be able to
have my program function correctly and generates a PDF file with chinese characters. Code snippit: 

BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); 
Font fontChinese = new Font(bfChinese, 13, Font.NORMAL); 




After I did the update, this line of code no longer works. It's throwing me this exception: 

com.itextpdf.text.DocumentException: Font 'STSong-Light' with 'UniGB-UCS2-H' is not recognized. 

I already imported iTextAsian.jar (as it worked for me before the update). 

Thanks! 
John
Reply |  Threaded |  More       star

Re: Asian font not recognized after update

4767 posts
We will probably ban users with a hotmail or gmail address 
in the future, so it's probably better to use you Wipro address 
so that we know who we are talking to, Mr. Supreme... 

Also: you should subscribe to the list. 

On 12/10/2010 7:01, supremelmfz wrote: 
> After I did the update, this line of code no longer works. It's throwing me 
> this exception: 

> com.itextpdf.text.DocumentException: Font 'STSong-Light' with 'UniGB-UCS2-H' 
> is not recognized. 

> I already imported iTextAsian.jar (as it worked for me before the update). 

I think you are using the old iTextAsian.jar. 

In the old iTextAsian.jar there are directories 
com/lowagie/text/pdf/fonts 
In the new iTextAsian.jar there are directories 
com/itextpdf/text/pdf/fonts 

The new iTextAsian.jar won't work for the old iText, 

and vice versa. 

你可能感兴趣的:(exception)