This commit is contained in:
1073413548 2024-08-09 16:51:40 +08:00
parent 3760c669ff
commit 811558346b

View File

@ -56,7 +56,7 @@ public class PdfGenerator {
public static void makePdf(Map<String, Object> data ,String pdfpath,String templateName) throws Exception{
// 设置模板目录
Configuration configuration = new Configuration(Configuration.VERSION_2_3_31);
File file = new File(System.getProperty("user.dir") + "\\doc");
File file = new File(System.getProperty("user.dir") + "/doc");
configuration.setDirectoryForTemplateLoading(file);
// 加载模板
Template template = configuration.getTemplate(templateName);