htmltopdf
前端生成
- html2canvas+jspdf
后端生成
wkhtmltopdf
- 中文乱码处理
<meta http-equiv="content-type" content="text/html;charset=utf-8">
- windows 下载wkhtmltox-0.12.5-1.msvc2015-win64.exe 安装之后直接运行命令
D:\softInstall\wkhtmltopdf\bin> wkhtmltopdf test.html test.pdf
2.linux 下载wkhtmltox-0.12.5-1.centos7.x86_64.rpm
- contenos yum install wkhtmltox-0.12.5-1.centos7.x86_64.rpm
- liunx 下会出现空白和乱码,把window字体C:\Windows\Fonts\SIMSUN.TTC上传字体库到 /usr/share/fonts就可以