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

1T3XT BVBA
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. 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值