无法创建MicrosoftWordBridge-Documents4j

时间:2018-08-22 14:24:53

标签: java documents4j

我有这个问题。

class com.documents4j.conversion.msoffice.MicrosoftWordBridge could not be created by a (File, long, TimeUnit) constructor
at com.documents4j.conversion.ExternalConverterDiscovery.make(ExternalConverterDiscovery.java:32)
at com.documents4j.conversion.ExternalConverterDiscovery.makeAll(ExternalConverterDiscovery.java:42)
at com.documents4j.conversion.ExternalConverterDiscovery.loadConfiguration(ExternalConverterDiscovery.java:85)
at com.documents4j.conversion.DefaultConversionManager.<init>(DefaultConversionManager.java:22)
at com.documents4j.job.LocalConverter.makeConversionManager(LocalConverter.java:79)
at com.documents4j.job.LocalConverter.<init>(LocalConverter.java:51)
at com.documents4j.job.LocalConverter$Builder.build(LocalConverter.java:186)

注意:

  • 已安装MS Office
  • PDF / XPS附加组件已安装在MS Office中。

我的代码:

File wordFile = new File(inputFile), target = new File(outputFile);
File temp = new File("D:\\directorio_aplicacion\\todos\\pisac\\docs\\");

IConverter converter = LocalConverter.builder()
                                .baseFolder(temp)
                                .workerPool(20, 25, 2, TimeUnit.SECONDS)
                                .processTimeout(5, TimeUnit.SECONDS)
                                .build();

Future<Boolean> conversion = converter.convert(wordFile).as(DocumentType.PDF)
                                .to(target).as(DocumentType.DOCX)
                                .schedule();

请。 我该如何解决这个错误?

Jar in Project

0 个答案:

没有答案