之前写过maven依赖下的HTML转PDF方案。采用的是flying-saucer。
当时的maven依赖如下
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf</artifactId>
<version>9.0.8</version>
<!-- https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>1.1.0</version>
</dependency>
之后碰到非maven项目需要实现,发现包缺失。排查之后发现需要以下几个jar包。
pdfbox
flying-saucer-core
flying-saucer-pdf
itext
希望能帮助到需要的人。