恢复到以前
This commit is contained in:
parent
78e2df602a
commit
bad2cbc494
|
|
@ -58,12 +58,12 @@
|
|||
<dependency>
|
||||
<groupId>com.documents4j</groupId>
|
||||
<artifactId>documents4j-local</artifactId>
|
||||
<version>1.1.3</version>
|
||||
<version>1.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.documents4j</groupId>
|
||||
<artifactId>documents4j-transformer-msoffice-word</artifactId>
|
||||
<version>1.1.3</version>
|
||||
<version>1.0.3</version>
|
||||
</dependency>
|
||||
<!--处理word文档需要的额外的jar包-->
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -51,13 +51,11 @@ public class OfficeFileUtil {
|
|||
}
|
||||
log.info("Start convert word file to pdf, word path: {}, pdf path: {}", wordPath, pdfPath);
|
||||
if (EleCommonUtil.isWinOs()) {
|
||||
String tmpPath = FileUtil.getParent(pdfPath, 1);
|
||||
File workDir = new File(tmpPath);
|
||||
File inputWord = new File(wordPath);
|
||||
File outputFile = new File(pdfPath);
|
||||
try (InputStream docxInputStream = Files.newInputStream(inputWord.toPath());
|
||||
OutputStream outputStream = Files.newOutputStream(outputFile.toPath())) {
|
||||
IConverter build = LocalConverter.builder().baseFolder(workDir).build();
|
||||
IConverter build = LocalConverter.builder().build();
|
||||
boolean execute;
|
||||
if (wordPath.endsWith(".docx")) {
|
||||
execute = build.convert(docxInputStream)
|
||||
|
|
|
|||
Loading…
Reference in New Issue