# TemplateReportPDF **Repository Path**: wangwang_1_1665527118/template-report-pdf ## Basic Information - **Project Name**: TemplateReportPDF - **Description**: 使用Java后端实现pdf生成跟批量打包压缩下载 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-10 - **Last Updated**: 2025-09-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 模板导出PDF 这个需求算是碰到两次了,第一次做的时候还是在做.net的时候,.net里面有别人封装号的nuget包 这个功能实现的整体思路:先写出静态HTML,然后通过模板引擎把数据解析到静态HTML中,最后通过wkhtmltopdf这个工具进行转换 https://wkhtmltopdf.org/docs.html 在Java中好像也有开箱直接用的maven包,但是没文档,只能自己通过jarb包自动生成的文档自己看, 后面我感觉这样也不方便然后就在gitee上一顿找,也找到一个可用的基于这个进行扩展的,选这个是因为他有演示效果感觉上手就有思路了 https://gitee.com/syxyw/html2file ## 最后看看效果 ### 导出pdf访问路径 http://localhost:7788/exportPdf/export ![导出pdf访问路径](doc/PixPin_2025-09-10_11-17-41.png) ### 批量导出访问路径 http://localhost:7788/exportPdf/batchexport ![批量导出访问路径](doc/PixPin_2025-09-10_11-17-01.png)