Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
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
fangxinjiang
yifu-mvp
Commits
6a7130f1
Commit
6a7130f1
authored
May 29, 2025
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.7.11-是否自动生成解除劳动合同书 0否1是
parent
f0a54cb9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
WordToImageUtil.java
.../yifu/cloud/plus/v1/yifu/social/util/WordToImageUtil.java
+6
-5
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/util/WordToImageUtil.java
View file @
6a7130f1
...
@@ -106,13 +106,13 @@ public class WordToImageUtil {
...
@@ -106,13 +106,13 @@ public class WordToImageUtil {
}
}
// 在生产环境中,建议在整个应用生命周期中共享一个OfficeManager:
// 在生产环境中,建议在整个应用生命周期中共享一个OfficeManager:
public
static
OfficeManager
OFFICE_MANAGER
;
public
OfficeManager
officeManager
;
static
{
public
void
initOfficeManager
()
{
OFFICE_MANAGER
=
LocalOfficeManager
.
builder
()
this
.
officeManager
=
LocalOfficeManager
.
builder
()
.
portNumbers
(
2003
)
.
portNumbers
(
2003
)
.
build
();
.
build
();
try
{
try
{
OFFICE_MANAGER
.
start
();
officeManager
.
start
();
}
catch
(
OfficeException
e
)
{
}
catch
(
OfficeException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -124,13 +124,14 @@ public class WordToImageUtil {
...
@@ -124,13 +124,14 @@ public class WordToImageUtil {
File
pdfFile
=
null
;
File
pdfFile
=
null
;
File
imgFile
=
null
;
File
imgFile
=
null
;
try
{
try
{
initOfficeManager
();
// Step 1: Word 转为 PDF(中间格式)
// Step 1: Word 转为 PDF(中间格式)
pdfFile
=
new
File
(
inputDocx
.
replace
(
".docx"
,
".pdf"
));
pdfFile
=
new
File
(
inputDocx
.
replace
(
".docx"
,
".pdf"
));
Map
<
String
,
Object
>
pdfProps
=
new
HashMap
<>();
Map
<
String
,
Object
>
pdfProps
=
new
HashMap
<>();
pdfProps
.
put
(
"FilterName"
,
"writer_pdf_Export"
);
pdfProps
.
put
(
"FilterName"
,
"writer_pdf_Export"
);
pdfProps
.
put
(
"SelectPdfVersion"
,
1
);
// PDF/A-1
pdfProps
.
put
(
"SelectPdfVersion"
,
1
);
// PDF/A-1
LocalConverter
.
builder
()
LocalConverter
.
builder
()
.
officeManager
(
OFFICE_MANAGER
)
.
officeManager
(
officeManager
)
.
storeProperties
(
pdfProps
)
.
storeProperties
(
pdfProps
)
.
build
()
.
build
()
.
convert
(
new
File
(
inputDocx
))
.
convert
(
new
File
(
inputDocx
))
...
...
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