使用破解版-aspose-words-19.5jdk.jar
https://blog.csdn.net/aley/article/details/127914145
Document wordDoc = new Document(wordFileInputStream);
wordDoc.save(pdfFile, new PdfSaveOptions());
在linux中使用会造成中文乱码问题
解决方案:复制全部win字体到服务器,然后在代码里引用路径即可
在word文档里面设置好分页符即可,路径:页面布局-分隔符-下一页分节符
遍历每一页 wordDoc.getSections(),然后.getPageSetup()设置边距即可
https://www.cnblogs.com/paopaolx/p/16539342.html
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
<!-- 项目中单独引入第三方jar时,includeSystemScope值要为true -->
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
</build>
转出的PDF需要落地
字体也是读取本地路径
https://gitee.com/zhaomingjian/workspace_luoan_demo/tree/master/word2pdf