问题描述
iTextSharp.text.DocumentException:Font'STSong-Light'with'UniGB-UCS2-H'isnotrecognized.行34:BaseFont.AddToResourceSearch("iTextAsian.dll");行35:BaseFont.AddToResourceSearch("iTextAsianCmaps.dll");行36:BaseFontbaseFont=BaseFont.CreateFont("STSong-Light","UniGB-UCS2-H",BaseFont.EMBEDDED);行37://BaseFontbaseFont=BaseFont.CreateFont("C:\WINDOWS\FONTS\STSONG.TTF",BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED);行38://Fontfont8=newFont(baseFont,7,Font.BOLD);//FontFactory.GetFont("宋体",7,Font.BOLD);备注:BaseFontbaseFont=BaseFont.CreateFont("C:\WINDOWS\FONTS\STSONG.TTF",BaseFont.IDENTITY_H,BaseFont.EMBEDDED);这种方式用系统的字体确实是可以的,但是生成的pdf会很大。所以我想用的是dll里面的字体求助,help!
解决方案
时间: 2024-11-05 12:29:40