在做pdf打印的时候遇到字体包找不到
出错在:
BaseFont base = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.EMBEDDED);
这时使用iTextAsian.jar中的字体 ,字体没有在jar资源中找到,可以换一种方式,使用系统字体资源:
BaseFont base = BaseFont.createFont("C:/windows/fonts/simsun.ttc,1", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
或者自定义资源路径:
BaseFont base = BaseFont.createFont(Path+File.separator+"SIMSUN.ttc,1", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
字体资源