修改字体文件路径
This commit is contained in:
@@ -64,8 +64,8 @@ public class TGiftBookDetailsServiceImpl implements ITGiftBookDetailsService {
|
||||
|
||||
private final ITGiftBookService giftBookService;
|
||||
|
||||
@Value("${ttfFile.path}")
|
||||
private String ttfPath;
|
||||
@Value("${ttfFile.name}")
|
||||
private String ttfName;
|
||||
|
||||
|
||||
/**
|
||||
@@ -243,7 +243,8 @@ public class TGiftBookDetailsServiceImpl implements ITGiftBookDetailsService {
|
||||
Document document = new Document(pdfDoc, PageSize.A4, false);
|
||||
|
||||
// 设置字体
|
||||
PdfFont font = PdfFontFactory.createFont(ttfPath, PdfEncodings.IDENTITY_H);
|
||||
ClassPathResource classPathResource = new ClassPathResource("font/" + ttfName);
|
||||
PdfFont font = PdfFontFactory.createFont(classPathResource.getPath(), PdfEncodings.IDENTITY_H);
|
||||
document.setFont(font);
|
||||
pdfDoc.addNewPage();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user