Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vehicle-quality-review
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王飞
vehicle-quality-review
Commits
63aa92b4
Commit
63aa92b4
authored
Mar 27, 2024
by
盖献康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
检验报告 - PDF文件title
parent
508c8ae5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
PdfTemplateManagementServiceImpl.java
.../ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
+2
-4
receipt_template_03_27.pdf
...ew/src/main/resources/template/receipt_template_03_27.pdf
+0
-0
No files found.
quality-review/src/main/java/com/ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
View file @
63aa92b4
...
@@ -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_0
2
_27.pdf"
;
String
fileName
=
"/template/receipt_template_0
3
_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
()
);
}
}
/**
/**
...
...
quality-review/src/main/resources/template/receipt_template_0
2
_27.pdf
→
quality-review/src/main/resources/template/receipt_template_0
3
_27.pdf
View file @
63aa92b4
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment