### 将html模板换成pdf格式的工具
### 配置示例
```yml
medway:
platform:
html2pdf:
template-infos:
configKeyOne:
template-path: 'templates/测试第一个模板.html'
configKeyTwo:
template-path: 'templates/测试第二个模板.html'
## 不配置默认是 黑体
font-path: 'font/msyh.ttf'
```
## ttf 字体库下载地址: http://www.font5.com.cn/fontlist/fontlist_1_1.html
#### 代码示例
```java
@Slf4j
@RequestMapping("/api/v1/html2pdf")
@RestController
public class Html2pdfControllerTest {
private static final String CONFIG_KEY = "configKeyTwo";
@Autowired
private Html2pdfControllerHelper html2pdfControllerHelper;
@GetMapping("test")
public void onlinePreview(HttpServletResponse response) throws IOException {
Map<String, Object> map = new HashMap<>();
map.put("doctorName", "测试名称.");
map.put("doctorTel", "测试电话@");
map.put("teamName", "测试团队");
map.put("patientName", "测试病人名称@#");
map.put("patientTel", "测试病人电话");
map.put("idCard", "421111111111111111");
html2pdfControllerHelper.htmlToPdf(response, map, CONFIG_KEY);
}
}
```
### map参数说明
html文件对应使用 ${doctorName}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
html2pdf.zip (59个子文件)
medway-starter-html2pdf
pom.xml 1KB
src
test
resources
font
msyh.ttf 14.37MB
templates
测试第二个模板.html 32KB
测试第一个模板.html 6KB
application.yaml 274B
java
cloud
medway
platform
html2pdf
TestApplication.java 453B
tests
HtmlPdfControllerHelperTest.java 2KB
controller
Html2pdfControllerTest.java 1KB
main
resources
font
simhei.ttf 9.58MB
META-INF
spring.factories 131B
java
cloud
medway
platform
html2pdf
helper
Html2pdfControllerHelper.java 7KB
props
TemplateInfo.java 539B
Html2pdfProperties.java 538B
common
WsConst.java 319B
config
Html2pdfAutoConfiguration.java 512B
.idea
jarRepositories.xml 1KB
uiDesigner.xml 9KB
vcs.xml 191B
workspace.xml 7KB
misc.xml 480B
compiler.xml 824B
checkstyle-idea.xml 632B
modules.xml 293B
.gitignore 184B
sonarlint
issuestore
d
9
e
0
8
e
8ec9a00bfd09b3190ac6b22251dbb1aa95a0579d 0B
index.pb 882B
9
0
901f3f2fd61f2acedd0156fd512c37dcfb82bda6 0B
1
0
1
f
1f57fcc5b7b9d3ab32aaace1fea57f18f0d3f821 0B
1f28d4bca38ea66be47902b0d3b1fecbd17f8bd3 65B
2
e
6
4
6488e26074de1c5911651111ea5ad7b86b8c328b 0B
f
0
e
9
3
4
c
4c96e100902e48447ff433565b8fb7d8101723af 0B
4
442292b8a7efeabbe4cc176709b833b1792140ec 0B
7
d
3
e
3e571b54b8ca20f95e90f2bbfc93970b7c71192d 127B
f
encodings.xml 191B
target
classes
font
simhei.ttf 9.58MB
cloud
medway
platform
html2pdf
helper
Html2pdfControllerHelper.class 8KB
props
TemplateInfo.class 2KB
Html2pdfProperties.class 2KB
common
WsConst.class 397B
config
Html2pdfAutoConfiguration.class 748B
META-INF
spring-configuration-metadata.json 602B
spring.factories 131B
medway-starter-html2pdf-0.0.5-SNAPSHOT.jar 5.04MB
test-classes
font
msyh.ttf 14.37MB
templates
测试第二个模板.html 32KB
测试第一个模板.html 6KB
cloud
medway
platform
html2pdf
TestApplication.class 828B
tests
HtmlPdfControllerHelperTest.class 4KB
controller
Html2pdfControllerTest.class 2KB
application.yaml 274B
maven-status
maven-compiler-plugin
compile
default-compile
createdFiles.lst 0B
inputFiles.lst 804B
testCompile
default-testCompile
createdFiles.lst 0B
inputFiles.lst 492B
medway-starter-html2pdf-0.0.4-SNAPSHOT.jar 5.04MB
surefire-reports
TEST-cloud.medway.platform.html2pdf.tests.HtmlPdfControllerHelperTest.xml 21KB
cloud.medway.platform.html2pdf.tests.HtmlPdfControllerHelperTest.txt 381B
maven-archiver
pom.properties 91B
generated-test-sources
test-annotations
generated-sources
annotations
README.md 1KB
共 59 条
- 1
资源评论
大大的男孩
- 粉丝: 7
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功