Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
slm-fileview
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
梁杰芳
slm-fileview
Commits
13123f8f
Commit
13123f8f
authored
May 27, 2019
by
陈精华
Committed by
kl
Jun 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addTask转码优化
parent
189bc396
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
OfficeFilePreviewImpl.java
...in/java/cn/keking/service/impl/OfficeFilePreviewImpl.java
+2
-2
No files found.
jodconverter-web/src/main/java/cn/keking/service/impl/OfficeFilePreviewImpl.java
View file @
13123f8f
...
@@ -47,7 +47,7 @@ public class OfficeFilePreviewImpl implements FilePreview {
...
@@ -47,7 +47,7 @@ public class OfficeFilePreviewImpl implements FilePreview {
public
String
filePreviewHandle
(
String
url
,
Model
model
)
{
public
String
filePreviewHandle
(
String
url
,
Model
model
)
{
// 预览Type,参数传了就取参数的,没传取系统默认
// 预览Type,参数传了就取参数的,没传取系统默认
String
officePreviewType
=
model
.
asMap
().
get
(
"officePreviewType"
)
==
null
?
ConfigConstants
.
getOfficePreviewType
()
:
model
.
asMap
().
get
(
"officePreviewType"
).
toString
();
String
officePreviewType
=
model
.
asMap
().
get
(
"officePreviewType"
)
==
null
?
ConfigConstants
.
getOfficePreviewType
()
:
model
.
asMap
().
get
(
"officePreviewType"
).
toString
();
String
originUrl
=
model
.
asMap
().
get
(
"originUrl"
).
toString
(
);
String
originUrl
=
(
String
)
model
.
asMap
().
get
(
"originUrl"
);
FileAttribute
fileAttribute
=
fileUtils
.
getFileAttribute
(
url
);
FileAttribute
fileAttribute
=
fileUtils
.
getFileAttribute
(
url
);
String
suffix
=
fileAttribute
.
getSuffix
();
String
suffix
=
fileAttribute
.
getSuffix
();
String
fileName
=
fileAttribute
.
getName
();
String
fileName
=
fileAttribute
.
getName
();
...
@@ -81,7 +81,7 @@ public class OfficeFilePreviewImpl implements FilePreview {
...
@@ -81,7 +81,7 @@ public class OfficeFilePreviewImpl implements FilePreview {
fileUtils
.
addConvertedFile
(
pdfName
,
fileUtils
.
getRelativePath
(
outFilePath
));
fileUtils
.
addConvertedFile
(
pdfName
,
fileUtils
.
getRelativePath
(
outFilePath
));
}
}
}
}
if
(!
isHtml
&&
(
OFFICE_PREVIEW_TYPE_IMAGE
.
equals
(
officePreviewType
)
||
OFFICE_PREVIEW_TYPE_ALLIMAGES
.
equals
(
officePreviewType
)))
{
if
(!
isHtml
&&
originUrl
!=
null
&&
(
OFFICE_PREVIEW_TYPE_IMAGE
.
equals
(
officePreviewType
)
||
OFFICE_PREVIEW_TYPE_ALLIMAGES
.
equals
(
officePreviewType
)))
{
List
<
String
>
imageUrls
=
pdfUtils
.
pdf2jpg
(
outFilePath
,
pdfName
,
originUrl
);
List
<
String
>
imageUrls
=
pdfUtils
.
pdf2jpg
(
outFilePath
,
pdfName
,
originUrl
);
if
(
imageUrls
==
null
||
imageUrls
.
size
()
<
1
)
{
if
(
imageUrls
==
null
||
imageUrls
.
size
()
<
1
)
{
model
.
addAttribute
(
"msg"
,
"office转图片异常,请联系管理员"
);
model
.
addAttribute
(
"msg"
,
"office转图片异常,请联系管理员"
);
...
...
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