Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chuanshan_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
廖旭伟
chuanshan_gov_platform
Commits
254100cf
Commit
254100cf
authored
Sep 08, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化word转换工具,最多只转换3页
parent
180f8d8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
single-matter/src/main/java/com/mortals/xhx/common/utils/WordUtil.java
.../src/main/java/com/mortals/xhx/common/utils/WordUtil.java
+5
-2
No files found.
single-matter/src/main/java/com/mortals/xhx/common/utils/WordUtil.java
View file @
254100cf
...
...
@@ -92,6 +92,9 @@ public class WordUtil {
options
.
setUseAntiAliasing
(
true
);
options
.
setUseHighQualityRendering
(
true
);
int
pageCount
=
doc
.
getPageCount
();
if
(
pageCount
>
2
){
pageCount
=
2
;
}
List
<
BufferedImage
>
imageList
=
new
ArrayList
<
BufferedImage
>();
for
(
int
i
=
0
;
i
<
pageCount
;
i
++)
{
OutputStream
output
=
new
ByteArrayOutputStream
();
...
...
@@ -234,9 +237,9 @@ public class WordUtil {
}
public
static
void
main
(
String
[]
args
)
{
String
docPath
=
"
E:\\pic\\doc\\2.docx
"
;
String
docPath
=
"
D:\\home\\mortals\\app\\施工合同(示范文本).doc
"
;
String
jpgPath
=
"
E:\\pic\\doc\\2
.jpg"
;
String
jpgPath
=
"
D:\\home\\mortals\\app\\aaa
.jpg"
;
WordUtil
.
convertWordToJPEG
(
docPath
,
jpgPath
);
/*
...
...
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