ITEXT5 Font

ITEXT5 Font ‘d:\SIMSUN.TTC’ with ‘Identity-H’ is not recognized.

用 itextsharp 制作PDF文件的时候发生错误

Font ‘d:\SIMSUN.TTC’ with ‘Identity-H’ is not recognized.

原本是

BaseFont baseFT = BaseFont.CreateFont("d:\SIMSUN.TTC", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);

应修改为:

BaseFont baseFT = BaseFont.CreateFont("d:\SIMSUN.TTC,1", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);

在字体路径的后面加了一个“,0”解决了,虽然不知道为什么,但是猜测这个是字体组有关,因为雅黑有三种,常规、加粗、极细

原文:https://www.cnblogs.com/oskyhg/p/7248438.html

你可能感兴趣的:(ITEXT5 Font)