本文讲解java在Springboot框架下使用百度的富文本编辑器ueditor,将富文本编辑器中的内容以html语言的形式保存到数据库中,然后从数据库中导出内容为pdf。
首先,在pom.xml包中引入itext5。
<!-- itext5 start -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.10</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-asian</artifactId>
<version>5.2.0</version>
</dependency>
<dependency>
<groupId>com.itextpdf.tool</groupId>
<artifactId>xmlworker</artifactId>
<version>5.5.11</version>
</dependency>
<!-- itext5 end -->
关于百度的富文本编辑器的使用,本文不再讲解,只说在保存html文本到数据库中有一个坑。就是在将html语言导出为pdf文件时,默认的html语言的style一定要有关于字体的设置,否则