错误写法:
PdfFontFactory.createFont("C:\\Windows\\Fonts\\simsun.ttc", PdfEncodings.IDENTITY_H,false);
BaseFont.CreateFont("C:\\Windows\\Fonts\\simsun.ttc", PdfEncodings.IDENTITY_H,false)
这两种写法是不对的,路径后面加上“,0”就好了;
正确写法:
PdfFontFactory.createFont("C:\\Windows\\Fonts\\simsun.ttc,0", PdfEncodings.IDENTITY_H,false);
BaseFont.CreateFont("C:\\Windows\\Fonts\\simsun.ttc,0", PdfEncodings.IDENTITY_H,false);
查询源码
所以必须加逗号,后面加上0或者1,大于1会报错,