Home  >  Article  >  php教程  >  thinkphp整合tcpdf插件,数据导出为pdf文件,支持中文

thinkphp整合tcpdf插件,数据导出为pdf文件,支持中文

WBOY
WBOYOriginal
2016-06-07 11:37:022061browse

thinkphp整合tcpdf插件,数据导出为pdf文件,附件里边整合的是生成pdf表格数据,


tcpdf插件被放在\ThinkPHP\Library\Vendor文件夹下;
导出方法export_pdf(可放到公共类)
thinkphp整合tcpdf插件,数据导出为pdf文件,支持中文

传入表头,表格数据,便可直接生成pdf文件:public function index(){<br>         $title=array('表1','表2','表3','表4');<br>         $data=array(array('嘻嘻哈哈','123tcpdf','呵呵','哈哈'),array('嘻嘻哈哈','123tcpdf','呵呵','哈哈'));<br>         $this->export_pdf($title,$data);<br>     }附件下载地址http://pan.baidu.com/s/1dDx374d

另附上官网的例子http://www.tcpdf.org/examples.php,大家可以参照修改!

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn