Apache_OpenOffice4和jodconverter-2.2.2.jar转pdf html(附文件下载)
第一步 Apache_OpenOffice 官网下载 下一步傻瓜式安装
启动openoffice
cmd到 C:\Program Files (x86)\OpenOffice 4\program
启动命令 soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
第二步 添加pom依赖 导入jodconverter-2.2.2.jar ( 注意maven仓库里只有2.2.1.jar,但2.2.1版本不支持docx、xlsx、pptx转换 ,需要手动更改pom文件添加2.2.2.jar )
jodconverter-2.2.2.jar 下载链接: https://pan.baidu.com/s/1LJ9rt3Ovcq3pF5q9JdZKtg 提取码: h3kh
<dependency>
<groupId>org.openoffice</groupId>
<artifactId>juh</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.openoffice</groupId>
<artifactId>ridl</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.openoffice</groupId>
<artifactId>unoil</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>com.artofsolving</groupId>
<artifactId>jodconverter</artifactId>
<version>2.2.2</version>
<scope>system</scope> <!--system,类似provided,需要显式提供依赖的jar以后,Maven就不会在Repository中查找它-->
<systemPath>${