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

检验报告 - PDF文件title

parent 508c8ae5
......@@ -71,21 +71,19 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
ByteArrayOutputStream bos = null;
try {
// 模板绝对路径--服务器
String fileName = "/template/receipt_template_02_27.pdf";
String fileName = "/template/receipt_template_03_27.pdf";
// 读取现有模板内容
reader = new PdfReader(fileName);
// 创建输出流
bos = new ByteArrayOutputStream();
// 实例化PdfStamper准备编辑pdf内容
ps = new PdfStamper(reader, bos);
// 获取表单所有元素
AcroFields fields = ps.getAcroFields();
// 设置具体字体格式的编码, 不设置的话中文可能不会显示
BaseFont bf = BaseFont.createFont("STSongStd-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
fields.addSubstitutionFont(bf);
// 测试数据
InspectionReportPdfVO inspectionReportPdfVO = requireData(taskId);
......@@ -178,7 +176,7 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
document.close();
// 上传到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