1.pom.xml依赖
<dependency>
<groupId>org.jodconverter</groupId>
<artifactId>jodconverter-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.jodconverter</groupId>
<artifactId>jodconverter-local</artifactId>
</dependency>
2.配置properties文件
jodconverter.local.enabled=true
jodconverter.local.office-home=C:\\Program Files (x86)\\OpenOffice 4
3.转换代码
@Resource
private DocumentConverter documentConverter;
@Override
public void convert(File source, File target) throws Exception {
documentConverter.convert(source).to(target);
}