Skip to content

ah-guobing/html2pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

html2pdf

HTML文件转换为PDF文件

环境要求

  • JDK:>=1.8
  • OS:Windows / Linux / MacOS

服务端搭建(以Linux环境为例)

# nohup java -jar html2pdf-0.0.1-SNAPSHOT.jar --server.port=端口号(默认8080) --font.path=PDF需要使用的字体路径 >>./serv.log &
如:
# nohup java -jar html2pdf-0.0.1-SNAPSHOT.jar --font.path=/home/tmpl2pdf/font/simsun.ttc >>./serv.log &
执行后,访问 http://ip:port/about 若出现版本等信息,说明服务端搭建成功。

客户端调用

API:http://ip:port/html2pdf?htmlFile=HTML文件模板完整路径名&pdfFile=生成后的PDF文件完整路径名
如:
http://localhost:8080/html2pdf?htmlFile=/Users/guobingbing/Work/MyProject/tmpl2pdf/font/a.html&pdfFile=/Users/guobingbing/Work/MyProject/tmpl2pdf/font/a.pdf

HTML模板文件的要求

问题反馈

使用中若有问题请联系微信号:tahaoku

About

HTML文件转换为PDF文件

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages