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).
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.