在drupal中,实现将node转化为pdf,并下载

本文是以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.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值