本文是以drupal框架下作为描述的根据
1. 下载drupal的第三方模块:print模块,里面有个子模块print_pdf支持这个功能
2. 登录linux
3. $ cd /usr/src (可换成其他目录)
4. 我使用wkhtmltopdf to general PDF,所以去http://code.google.com/p/wkhtmltopdf/downloads/list 下载合适的版本
5. 我的测试服务器是64位的,所以下载这个版本:wkhtmltopdf-0.9.9-static-amd64.tar.bz2
6. $ wget wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2
7. $ tar xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2
8. $ mv wkhtmltopdf-amd64 /usr/bin/wkhtmltopdf
9. $ cd /var/www/sites/all/libraries
10. $ ln -s /usr/bin/wkhtmltopdf wkhtmltopdf
11. Then go to /admin/settings/print/pdf and "sites/all/libraries/wkhtmltopdf" will be displayed on the right hand side of a radio button. Activate it and save, go to a page and hit the PDF link.
Chinese character support:
The wkhtmltopdf supports Chinese character as its feature. So ,we just need to install Chinese fonts in the Ubuntu server.
1. copy all the fonts of Chinese character from MS windows XP directory 'c:/windows/fonts'(//I just copied all fonts from this directory.) to Ubuntu usr/share/fonts/zh_CN
2.excute $fc-cache to refresh Ubuntu fonts
3.Reboot the server.