修改字体代码

This commit is contained in:
xzh
2025-03-26 01:11:49 +08:00
parent 8a772cae16
commit 35b8e7d05c

View File

@@ -243,8 +243,7 @@ public class TGiftBookDetailsServiceImpl implements ITGiftBookDetailsService {
Document document = new Document(pdfDoc, PageSize.A4, false);
// 设置字体
File file = new File(ttfPath);
PdfFont font = PdfFontFactory.createFont(file.getAbsolutePath(), PdfEncodings.IDENTITY_H);
PdfFont font = PdfFontFactory.createFont(ttfPath, PdfEncodings.IDENTITY_H);
document.setFont(font);
pdfDoc.addNewPage();