Java通过Html(ftl模板)生成PDF实战, 可支持商用

Java通过Html(freemarker模板)生成PDF实战, 可支持商用

技术架构

springboot + freemarker + [pdfbox] + flying-saucer-pdf

生成流程:

  1. freemarker: 根据数据填充ftl模板文件,得到包含有效数据的html文件(包含页眉页脚页码的处理,和解决中文渲染等问题)。
  2. flying-saucer-pdf: 将html转换成PDF文件。
  3. pdfbox: 操作PDF文件,完成加解密等操作。

依赖包

<!-- springboot版本, 2.2.x也是支持的 -->
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><version>3.3.0</version>
</dependency>
<!-- load freemarker template file --><dependency><groupId>org.freemarker</groupId><artifactId>freemarker</artifactId><version>2.3.30</version></dependency>
<!-- convert html to pdf --><dependency><groupId>org.xhtmlrenderer</groupId><artifactId>flying-saucer-pdf</artifactId><version>9.4.1</version></dependency><dependency><groupId>org.xhtmlrenderer</groupId><artifactId>flying-saucer-core</artifactId><version>9.4.1</version></dependency><!-- operate pdf, such as encypt/decypt,不做加解密可不引用 --><dependency><groupId>org.apache.pdfbox</groupId><artifactId>pdfbox</artifactId><version>2.0.24</version></dependency><!-- encrypt/decrypt zip --><dependency><groupId>net.lingala.zip4j</groupId><artifactId>zip4j</artifactId><version>2.11.5</version></dependency>
PS:网上很多文章使用 itext5/7来生成PDF的,用于个人学习或者开源项目确实没问题,但是不方便用于公司商业项目,因为itext是基于AGPL 的开源协议,商用是需要收费的,当然贵司愿意付费也是okay的。

1. 准备PDF的模板文件(freemarker文件)

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><title>PDF Demo Title</title><style>@page {size: A4;margin: 35mm 10mm 23mm 10mm;@top-center {content: element(headerTop);}@bottom-center {content: element(footerBottom);}}#pagenumber:before {content: counter(page);}#pagecount:before {content: counter(pages);}.headerTop {position: running(headerTop);color: white;}.footerBottom {color: #777E90;position: running(footerBottom);margin-top: 10mm;}* {padding: 0;margin: 0;}html,body {/*优先加载 Poppins英文字体,无法渲染则使用PingFang中文字体*/font-family: Poppins-Medium, PingFang, sans-serif;margin: 0 auto;}.content {color: #23262F;font-size: 8px;padding: 0 0;margin-top: 0;}.size16 {font-size: 16px;}.size12 {font-size: 12px;}.size10 {font-size: 10px;}.size8 {font-size: 8px;}.lineHeight18 {line-height: 18px;}.weight600 {font-weight: 600;}.weight500 {font-weight: 500;}.padding18 {padding: 18px;}.marginBottom8 {margin-bottom: 8px;}.marginLeft6 {margin-left: 6px;}.marginLeft24 {margin-left: 24px;}.marginLeft16 {margin-left: 16px;}.marginLeft13 {margin-left: 13px;}.marginLeft4 {margin-left: 4px;}.marginTop4 {margin-top: 4px;}.marginTop8 {margin-top: 8px;}.width140 {width: 140px;}.widthFull {width: 100%;}.heightFull {height: 100%;}.textAlignCenter {text-align: center;}.inlineCenter {display: inline-block;vertical-align: top;}.backGray {background-color: #F7F7F7;}.backBlue {background-color: #0E59F0;}.border {border: 1px solid #E5E5E5;}.colorBlue {color: #6E9BF6;}.colorDark {color: #777E90;}.colorBlack {color: #23262F;}.colorBottomLine {background-color: #6E9BF6;}.colorGray {color: #838CA4;}.table {border-spacing: 0;/*跨页表格标题*/-fs-table-paginate: paginate;}.table>thead>tr>th,.table>tbody>tr>td {padding: 16px 4px;text-align: left;word-break: break-all;word-wrap: break-word;white-space: normal;page-break-inside: avoid;page-break-after: auto;}.table>thead>tr>th {color: #838CA4;font-weight: 400;size: 12px;}.positionAbsolute {position: absolute;}.rightBottom8 {top: 80px;right: 30px;}.height8 {height: 8px;}.height6 {height: 6px;}.height16 {height: 16px;}.right0 {right: 0;}.lineGary {height: 1px;background-color: #E5E5E5;}</style>
</head><body>
<!-- 页眉 -->
<div class="headerTop"><img class="widthFull" style="margin-left: -1px" width="716px"src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QBARXhpZgAATU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAFiqADAAQAAAABAAAA2gAAAAD/7QA4UGhvdG9zaG9wIDMuMAA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jbXPNRWXSmXn3zVFIrM+aniICiqg61P2qiS0x4zWcxy2atD7tU26mhiHkZFR1IOlI1QxiKOakzgU3tTh0pAXrDPU1rCXBrLtPu1fWmi0y8r5qYSDGBVEVItUS0WS5HWkRuSarmnr0osS0aNohaXeegNdJJKPK69q56AkR8elTbm8vqaadiRZZdvOaoLdnccGq85OTzWeSc1KqMuMUdC99LjluKwLu5edvLT5mPQetRszZxk16j4RggeRC8at9QDWFSs1sb06KlucFp/hDX9QYP9lkjQ/wAbAY/Q169o2l6J4bgWW/MTyoMkDk5rsdZZobXEJKDb/Dx/Kvn3VmZrl2YknJ5NYw/eO0jdWpaxO713xybhmjs5GSLoB0rz6W6kuiTuLbq5qYkucmr9gTnrWjioaIzdR1Hqan2Fwu7Gajsbn7JdqzHABrqYQDbc+lcRe8XBx61je+hq1y2aO31xUuLUzqM/KOa87TIfj1rttzHSCCT0rjovv/jQhVdWjfhTdE2fQ19OeFphPo8XfCgV842oHln6V9CeCP8AkDD8aynsbwR14p9MoFZWKbJKSilosADilptKKLALRRRRYAzTqZUg6UrAFFBo70DQuKUcUlOpDDFLjFApTQA3mg06lPSgCOinUlUAUU4UtADadSjrRSAbUtN706kA00mDTqWgD//Z" /><div class="positionAbsolute rightBottom8 size12 weight500">${headerDate}</div>
</div><!-- 页脚 -->
<div class="footerBottom"><div class="height6 colorBottomLine"></div><div class="marginTop8 size10"><div class="inlineCenter">footer name<span class="marginLeft4 colorBlack"><![CDATA[${footerName}]]></span></div><!-- 页码 --><div class="inlineCenter colorBlack positionAbsolute right0"><span id="pagenumber"></span>/<span id="pagecount"></span></div></div>
</div><div class="content"><!-- 用户信息 --><div class="border padding18"><div class="colorBlue marginBottom8 weight500 size16"><![CDATA[${userName}]]></div><div class=""><span>Account Name</span><span class="colorBlue marginLeft6 weight500"><![CDATA[${accountName}]]></span><span class="marginLeft24">Account ID</span><span class="colorBlue marginLeft6 weight500"><![CDATA[${accountId}]]></span></div></div><div class="height8"></div><!-- 表格 --><section style="display: ${display}"><div class="height16"></div><div class=""><span class="colorBlack size16 weight600 marginLeft4 inlineCenter">Deposit</span></div><div class="marginTop8 weight500 colorBlack size10">Deposit History</div><div class="height16"></div><div class="lineGary"></div><div class="marginTop8"><table class="widthFull table"><thead><tr class="backGray"><th>Currency</th><th>Request ID</th><th>Bank Name</th><th>Bank Number</th><th>Amount</th><th>Time</th></tr></thead><tbody><#if list?? && (list?size> 0)><#list list as detail><tr><td>${detail.tokenCode}</td><td>${detail.orderNo}</td><td><#if detail.bankName??><![CDATA[${detail.bankName}]]><#else>-</#if></td><td><#if detail.bankNumber??><#-- 处理特殊字符的渲染 --><![CDATA[${detail.bankNumber}]]><#else>-</#if></td><td><#if detail.qty??>${detail.qty}<#else>-</#if></td><td><#if detail.updateTime??>${detail.updateTime}<#else>-</#if></td></tr></#list></#if></tbody></table></div><div class="height16"></div><div class="lineGary"></div></section>
</div>
</body>
</html>
freemarker模板注意事项:
  1. 图片需要通过base64的方式加载,直接加载图片路径可能无法渲染
  2. 字体名称需要和Java代码中加载的字体名称保持一致,中文无法渲染可能是没有设置别名
  3. 替换的变量,如果有null值需要在模板中判断
  4. 如果填充的变量中存在特殊字符,通过<![CDATA[${变量名}]]> 方式设置
  5. 部分高级的CSS样式或者标签可能不支持
  6. 页眉页脚采用running的方式处理

2. Java Code

2.1 FreeMarkerUtils

import freemarker.template.Configuration;
import freemarker.template.DefaultObjectWrapper;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import lombok.extern.slf4j.Slf4j;import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Map;@Slf4j
public class FreeMarkerUtils {private static Template getTemplate(String templateFileName) {Configuration configuration = new Configuration(Configuration.VERSION_2_3_29);Template template = null;try {configuration.setObjectWrapper(new DefaultObjectWrapper());//设置编码格式configuration.setDefaultEncoding("UTF-8");//模板文件configuration.setClassForTemplateLoading(FreeMarkerUtils.class, "/templates");template = configuration.getTemplate(templateFileName + ".ftl", StandardCharsets.UTF_8.toString());} catch (IOException e) {e.printStackTrace();log.error("get template file failed, fileName:{}", templateFileName);}return template;}public static String generateHtmlStr(Map<String, Object> variables, String templateFileName) {Template template = getTemplate(templateFileName);StringWriter stringWriter = new StringWriter();template.setEncoding("UTF-8");try (BufferedWriter writer = new BufferedWriter(stringWriter)) {template.process(variables, writer);String htmlStr = stringWriter.toString();writer.flush();return htmlStr;} catch (TemplateException e) {throw new RuntimeException(e);} catch (IOException e) {throw new RuntimeException(e);}}/*** 删除xml无法识别的非法字符* @param content* @return*/public static String removeIllegalChar(String content) {return content.replaceAll("[\\x00-\\x08\\x0b-\\x0c\\x0e-\\x1f]", "");}
}

2.2 PdfTest Code


import com.janche.pdf.utils.FileUtil;
import com.janche.pdf.utils.FreeMarkerUtils;
import com.janche.pdf.vo.PdfVo;
import com.lowagie.text.pdf.BaseFont;
import freemarker.cache.ClassTemplateLoader;
import lombok.extern.slf4j.Slf4j;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.encryption.AccessPermission;
import org.apache.pdfbox.pdmodel.encryption.StandardProtectionPolicy;
import org.xhtmlrenderer.pdf.ITextFontResolver;
import org.xhtmlrenderer.pdf.ITextRenderer;import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.IntStream;/*** @Description:* @Auther: lirong* @Date: 2024/04/16*/
@Slf4j
public class PdfTest {public static void main(String[] args) {ITextRenderer renderer = new ITextRenderer();try {addPdfFont(renderer);String htmlStr = FreeMarkerUtils.generateHtmlStr(loadPdfData(), "pdfTemplate");renderer.setDocumentFromString(FreeMarkerUtils.removeIllegalChar(htmlStr));renderer.layout();} catch (IOException e) {throw new RuntimeException(e);}File pdfFile = new File("output/demo.pdf");File encryptPdfFile = new File("output/demo_encrypt.pdf");File zipFile = new File("output/demo.zip");try (OutputStream os = new FileOutputStream(pdfFile)) {renderer.createPDF(os);// encrypt pdf, if needn't encrypt pdf file, can remove pdfBox dependencyPDDocument document = PDDocument.load(pdfFile);StandardProtectionPolicy policy = new StandardProtectionPolicy("123456", "1234", new AccessPermission());policy.setEncryptionKeyLength(128);policy.setPermissions(new AccessPermission());document.protect(policy);document.save(encryptPdfFile);document.close();} catch (Exception e) {throw new RuntimeException(e);}log.info("PDF file generated successfully!");}private static void addPdfFont(ITextRenderer renderer) throws IOException {// add English fontClassTemplateLoader classTemplateLoader = new ClassTemplateLoader(FreeMarkerUtils.class, "/static/font");String enFontPath = classTemplateLoader.getBasePackagePath() + "Poppins-Medium.ttf";ITextFontResolver fontResolver = renderer.getFontResolver();// the first font needn't set aliasfontResolver.addFont(enFontPath, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);// add Chinese font, the second font must set aliasString chFontPath = classTemplateLoader.getBasePackagePath() + "PingFang-Regular.ttf";fontResolver.addFont(chFontPath, "PingFang", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED, null);}public static Map<String, Object> loadPdfData() {Map<String, Object> data = new HashMap<>();// 启用data.put("display", "block");// 隐藏
//        data.put("display", "none");data.put("footerName", "footer-龍");data.put("userName", "龍年發财");data.put("accountName", "Jackson-龍");data.put("accountId", "234324");LocalDateTime now = LocalDateTime.now();DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");data.put("headerDate", now.format(dateFormatter));ArrayList<PdfVo> tableList = new ArrayList<>();IntStream.range(1, 20).forEach(i -> {LocalDateTime dateTime = now.plusDays(i);PdfVo pdfVo = PdfVo.builder().tokenCode("USD" + i).bankName("HK Bank" + i).bankNumber("&23**94&" + i).qty(BigDecimal.TEN.add(new BigDecimal(i))).orderNo("ab123445" + i).updateTime(dateTime.format(dateFormatter)).build();tableList.add(pdfVo);});data.put("list", tableList);return data;}
}
PS:
  1. 关于中文字体不显示的问题: 一般是字体未正确加载,或者读取时字体名称不正确,完全不需要去更改什么源码class文件,高版本的flying-saucer-pdf 早已支持。
  2. 加载多个字体时,后面的字体需要设置别名,ftl模板中也需要使用设置的别名。
字体文件:(可在文章底部的github项目中获取)
  1. PingFang-Regular.ttf 中文字体
  2. Poppins-Medium.ttf 英文字体

3. PDF展示

在这里插入图片描述

Github源码下载:https://github.com/Janche/springboot-html2pdf-demo

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/16761.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

InteractiveGraph图谱中vue项目中如何使用

InteractiveGraph图谱中vue项目中如何使用 一、下载js和css和字体二、vue2.0项目中引用三、grap组件 一、下载js和css和字体 //在这里面找 https://github.com/grapheco/InteractiveGraph/blob/master/dist/examples/example1.html二、vue2.0项目中引用 //main.js中全局引入$ …

导入 FDTD 仿真的 S 参数到 INTERCONNECT 的器件中

导入 FDTD 仿真的 S 参数到 INTERCONNECT 的器件中 正文正文 很多时候,仿真链路比较大时,我们可以将仿真的每个部分分隔开来,用 FDTD 计算出每一部分的 S 参数,然后将这些 S 参数导入 INTERCONNECT 中得到最终的仿真结果。这里我们来介绍一下这种方法。 首先,我们从右侧…

Linux系统安装AMH服务器管理面板并实现远程访问管理维护

目录 前言 1. Linux 安装AMH 面板 2. 本地访问AMH 面板 3. Linux安装Cpolar 4. 配置AMH面板公网地址 5. 远程访问AMH面板 6. 固定AMH面板公网地址 1. 部署Docker Registry 2. 本地测试推送镜像 3. Linux 安装cpolar 4. 配置Docker Registry公网访问地址 5. 公网远程…

【链表】Leetcode 92. 反转链表 II【中等】

反转链表 II 给你单链表的头指针 head 和两个整数 left 和 right &#xff0c;其中 left < right 请你反转从位置 left 到位置 right 的链表节点&#xff0c;返回 反转后的链表 。 示例 1&#xff1a; 输入&#xff1a;head [1,2,3,4,5], left 2, right 4 输出&#x…

Solidity 教程01 Remix IDE 初次见面

访问链接地址&#xff1a; https://remix.ethereum.org/ 文件管理器 文件资源管理器用于管理工作区和文件。此插件还包含许多快捷方式和命令。要快速浏览&#xff0c;请右键单击文件以获取弹出菜单&#xff0c;并检查插件右上角的汉堡菜单。 要找到文件资源管理器模块 - 单…

rust语言初识

程序设计实践课上水一篇ing 来源&#xff1a;rust基础入门-1.初识rust-酷程网 (kucoding.com) rust作为一名新兴语言&#xff0c;与go又有些许不同&#xff0c;因为它的目标是对标系统级开发&#xff0c;也就是C、C这两位在编程界的位置。比如我们最常用的windows系统&#x…

001.数据分析_NumPy

我 的 个 人 主 页&#xff1a;&#x1f449;&#x1f449; 失心疯的个人主页 &#x1f448;&#x1f448; 入 门 教 程 推 荐 &#xff1a;&#x1f449;&#x1f449; Python零基础入门教程合集 &#x1f448;&#x1f448; 虚 拟 环 境 搭 建 &#xff1a;&#x1f449;&…

【ai】pycharm设置软件仓库编译运行基于langchain的chatpdf

联想笔记本 y9000p创建python工程: 使用langchain支持openai的向量化embedding安装软件包 发现没有openai ,添加软件仓库打开工具窗口 点击设置

Jlink卡死 JFlash keil 盗版JLINK

现象&#xff1a;用Keil打开Jlink配置页&#xff0c;会卡死。 解决方法&#xff1a;用旧版本的Jlink软件&#xff0c;因为淘宝买的很多JLINK下载器是盗版的&#xff0c;不支持新版本的JLINK软件。到https://www.segger.com/downloads/jlink下载旧版本的软件。 如果必须要用新版…

SQLI-labs-第二十五关和第二十五a关

目录 第二十五关 1、判断注入点 2、判断数据库 3、判断表名 4、判断字段名 5、获取数据库的数据 第二十五a关 1、判断注入点 2、判断数据库 第二十五关 知识点&#xff1a;绕过and、or过滤 思路&#xff1a; 通过分析源码和页面&#xff0c;我们可以知道对and和or 进…

链表经典题目—相交链表和链表倒数第k个节点

&#x1f389;&#x1f389;&#x1f389;欢迎莅临我的博客空间&#xff0c;我是池央&#xff0c;一个对C和数据结构怀有无限热忱的探索者。&#x1f64c; &#x1f338;&#x1f338;&#x1f338;这里是我分享C/C编程、数据结构应用的乐园✨ &#x1f388;&#x1f388;&…

艾体宝干货 | 教程:使用ntopng和nProbe监控网络流量

本教程旨在分享如何通过 ntopng 和 nProbe 这两款工具&#xff0c;深入了解和掌握网络流量监控的艺术。我们将提供从基本概念到高级应用的全面指导&#xff0c;涵盖了在多种平台和设备上的部署和配置步骤。不论您是专业人员还是技术爱好者&#xff0c;跟随本教程&#xff0c;都…

11thingsboard物联网网关接入ThingsBoard物联网平台的操作说明

本文包含关于如何配置ThingsBoard 平台和连接钡铼技术R40设备的说明。ThingsBoard平台是一个用于数据收集、处理、可视化和设备管理的开源物联网平台。它通过行业标准MQTT协议实现设备连接。ThingsBoard结合了可扩展性、容错性和性能&#xff0c;因此您永远不会丢失数据。 4G L…

【考研数学】线代除了「李永乐」,还能跟谁?

考研线代&#xff0c;除了利用了老师&#xff0c;我觉得还有一个宝藏老师的课程值得听&#xff01; 那就是喻老&#xff0c;这个是我在b站上面新发现的老师&#xff0c;听完他的课程发现真的喜欢 他不仅在B站上开设了课程&#xff0c;还编写了配套的线性代数辅导讲义&#xff…

Python中的SSH、SFTP和FTP操作详解

大家好&#xff0c;在网络编程中&#xff0c;安全地连接到远程服务器并执行操作是一项常见任务。Python 提供了多种库来实现这一目标&#xff0c;其中 Paramiko 是一个功能强大的工具&#xff0c;可以轻松地在 Python 中执行 SSH、SFTP 和 FTP 操作。本文将介绍如何使用 Parami…

企业选择定制化MES管理系统时需要考虑的核心功能

在当今制造业的数字化转型浪潮中&#xff0c;企业对于实现生产现场透明管理的需求愈发迫切。为了满足这一需求&#xff0c;MES管理系统成为了众多企业的首选解决方案。MES管理系统以其高度的灵活性和可定制性&#xff0c;能够根据不同行业的特性&#xff0c;为企业提供量身定制…

看潮成长日程表用户手册(上)

看潮成长日程表用户手册&#xff08;上&#xff09; 一、特色功能1、以每周日程表为主要形式2、全时管控的时间管理3、持续的日程管理4、分期间时间表5、按日排程&#xff0c;按周输出6、夏季作息时间处理7、年度假日处理8、休息日处理9、弹性日程10、完成记录11、多种输出形式…

重构与优化-前言

关注公众号畅读:IT技术馆 Java代码重构是优化现有代码结构、提升代码可读性、可维护性和性能的过程,而不会改变其外在行为。这包括命名规范、消除重复代码、改进设计模式的使用、优化数据结构和算法等。下面是一些常见的Java代码重构技巧及示例: 1. 重命名(Rename) 目的…

光纤跳线组成结构划分你知道吗

按照组成结构划分 光纤跳线根据组成结构的不同可分为带状光纤跳线和束状光纤跳线。带状光纤跳线使用的是由光纤带组成的带状光缆&#xff0c;大多呈扁平形状&#xff0c;因具有较高的光纤密度&#xff0c;它可以容纳更多的纤芯&#xff0c;因此大大节省布线成本和空间&#xf…

猫咪掉毛严重怎么办?小米、希喂、霍尼韦尔宠物空气净化器测评

吸猫成瘾&#xff0c;养猫“致贫”&#xff1f;在当今社会&#xff0c;养猫已成为众多年轻人的一个追捧的事情。乖巧又可爱&#xff0c;下班回到家撸一把猫已经成为年轻人的日常。但是猫咪可爱也不影响它的各种养猫伴生的问题&#xff01;无论是漂浮的浮毛、飘散的皮屑还是偶发…