wkhtmltopdf折腾记
What for?
PRD: 打印条款以供用户下载。
After googling around,there are two possiable options:
iText. 以前一般都用这个来做PDF的生成,但试用了一下感觉很是难用!
wkhtmltopdf. 一个单独的程序,命令行可直接使用用,相对(也有一些坑)来说简单易用。官方介绍:
wkhtmltopdf
andwkhtmltoimage
are open source (LGPLv3) command line tools to render HTML into PDF and various image formats using the Qt WebKit rendering engine. These run entirely “headless” and do not require a display or display service.