引入依赖
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.pdf.free</artifactId>
<version>3.9.0</version>
</dependency>
仓库
<repository>
<id>com.e-iceblue</id>
<url>https://repo.e-iceblue.cn/repository/maven-public/</url>
</repository>
项目代码
public class Pdf2Doc {
public static void main(String[] args) {
pdf2Doc("hello1.pdf","hello1.doc");
}
private static void pdf2Doc(String inputName,String outputName){
PdfDocument pdf = new PdfDocument();
pdf.loadFromFile(inputName);
//保存为doc
pdf.saveToFile(outputName, FileFormat.DOC);
}
}