Commit 63aa92b4 authored by 盖献康's avatar 盖献康

检验报告 - PDF文件title

parent 508c8ae5
...@@ -71,21 +71,19 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe ...@@ -71,21 +71,19 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
ByteArrayOutputStream bos = null; ByteArrayOutputStream bos = null;
try { try {
// 模板绝对路径--服务器 // 模板绝对路径--服务器
String fileName = "/template/receipt_template_02_27.pdf"; String fileName = "/template/receipt_template_03_27.pdf";
// 读取现有模板内容 // 读取现有模板内容
reader = new PdfReader(fileName); reader = new PdfReader(fileName);
// 创建输出流 // 创建输出流
bos = new ByteArrayOutputStream(); bos = new ByteArrayOutputStream();
// 实例化PdfStamper准备编辑pdf内容 // 实例化PdfStamper准备编辑pdf内容
ps = new PdfStamper(reader, bos); ps = new PdfStamper(reader, bos);
// 获取表单所有元素 // 获取表单所有元素
AcroFields fields = ps.getAcroFields(); AcroFields fields = ps.getAcroFields();
// 设置具体字体格式的编码, 不设置的话中文可能不会显示 // 设置具体字体格式的编码, 不设置的话中文可能不会显示
BaseFont bf = BaseFont.createFont("STSongStd-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); BaseFont bf = BaseFont.createFont("STSongStd-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
fields.addSubstitutionFont(bf); fields.addSubstitutionFont(bf);
// 测试数据 // 测试数据
InspectionReportPdfVO inspectionReportPdfVO = requireData(taskId); InspectionReportPdfVO inspectionReportPdfVO = requireData(taskId);
...@@ -178,7 +176,7 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe ...@@ -178,7 +176,7 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
document.close(); document.close();
// 上传到Minio // 上传到Minio
return uploadMinio(outputStream, "企业留档文件_" + taskId); return uploadMinio(outputStream, "企业留档文件-" + getReportName());
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment