由于使用poi组件无法解决附件乱码问题、公司又不愿意使用商业版本、最终选定了LibreOffice来做这个功能。先将ppt转pdf 在将pdf转图片
本文使用的版本为LibreOffice-7.0.0 可去官网[进行下载](https://zh-cn.libreoffice.org/download/libreoffice/) 分为Windows、Linux、mac版本。安装可查看[该博客](https://blog.csdn.net/eclothy/article/details/84938807)
以Windows版本为例代码讲解:(1) 安装完LibreOffice后需要配置环境变量并且重启电脑命令才可用
(2) pdf转图片需要引入以下jar包
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.9</version>
</dependency>
public final class Test {
public static void main(String[] args) throws NullPointerException {
long start = System.currentTimeMillis();
String srcPath = "C:/Users/Desktop/test.pptx", desPath =