81,094
社区成员
发帖
与我相关
我的任务
分享
String filePath = "hello.pdf";
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream(filePath));
document.open();
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H",BaseFont.NOT_EMBEDDED);
Font chineseFont= new Font(bfChinese, 12, Font.NORMAL);
PdfPCell cellReportSummary = new PdfPCell(new Phrase("支持中文",chineseFont));
document.add(cellReportSummary);
document.close();
,还是报: Font 'STSong-Light' with 'UniGB-UCS2-H' is not recognized.的错误,是不是我的classpath有问题,还是其他的?