|
@@ -44,15 +44,13 @@ public class PdfFilePreviewImpl implements FilePreview{
|
|
|
String outFilePath = fileDir + pdfName;
|
|
|
if (OfficeFilePreviewImpl.OFFICE_PREVIEW_TYPE_IMAGE.equals(officePreviewType) || OfficeFilePreviewImpl.OFFICE_PREVIEW_TYPE_ALLIMAGES.equals(officePreviewType)) {
|
|
|
|
|
|
- if (!new File(outFilePath).exists()) {
|
|
|
- ReturnResponse<String> response = downloadUtils.downLoad(fileAttribute, fileName);
|
|
|
- if (0 != response.getCode()) {
|
|
|
- model.addAttribute("fileType", suffix);
|
|
|
- model.addAttribute("msg", response.getMsg());
|
|
|
- return "fileNotSupported";
|
|
|
- }
|
|
|
- outFilePath = response.getContent();
|
|
|
+ ReturnResponse<String> response = downloadUtils.downLoad(fileAttribute, fileName);
|
|
|
+ if (0 != response.getCode()) {
|
|
|
+ model.addAttribute("fileType", suffix);
|
|
|
+ model.addAttribute("msg", response.getMsg());
|
|
|
+ return "fileNotSupported";
|
|
|
}
|
|
|
+ outFilePath = response.getContent();
|
|
|
List<String> imageUrls = pdfUtils.pdf2jpg(outFilePath, pdfName, originUrl);
|
|
|
if (imageUrls == null || imageUrls.size() < 1) {
|
|
|
model.addAttribute("msg", "pdf转图片异常,请联系管理员");
|