我有春季启动应用程序。在resources/static
我有字体CyrilicOld.TTF
如何获取此字体的路径?
public static final String FONT = "resources/static/CyrilicOld.TTF";
或
public static final String FONT = "/static/CyrilicOld.TTF";
...
BaseFont bf = BaseFont.createFont(FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED, false, null, null, false);
我收到错误
java.io.IOException:resources / static / CyrilicOld.TTF未找到文件或资源。
如果BaseFont.createFont(this.getClass().getResource("/static/CyrilicOld.TTF").getPath(), BaseFont.IDENTITY_H, BaseFont.EMBEDDED, false, null, null, false)
错误
com.itextpdf.text.DocumentException: Table 'name' does not exist in /C:/gitProjects/BillingInvoiceGenerator/target/classes/static/CyrilicOld.TTF