The need for PHP to generate PDF files is not very common;
Since it has been integrated, then write a blog to explain it;
Example Project: Http://git.oschina.net/shuaibai123/thinkphp-bjyadmin
One: Introduction of Tcpdf
/thinkphp/library/vendor/tcpdf
Copy the entire catalogue of Tcpdf to your project;
Two: function
/application/common/common/function.php
/** * generating pdf * @param string $html What needs to be generated */function pdf ($html = ' Three: How to use
Well, there's nothing to say, it's all in the comments;
More chestnuts:/thinkphp/library/vendor/tcpdf/examples
What needs to be noted is:
Can write HTML tags, such as the recognition of the H-tag font and increase the effect of bold;
Can write style, but not fully supported;
Tcpdf's official website requires a ladder: http://www.tcpdf.org
650) this.width=650; "alt=" Bai Jun Haruka Blog "src=" Http://baijunyao.com/Upload/image/ueditor/20160622/1466545069286893.jpg " title= "Bai Jun Haruka Blog"/>
This article for Bai Jun Remote original article, reprinted without contact with me, but please specify from Bai Jun remote blog http://baijunyao.com
Thinkphp Integration Series of the Tcpdf class to generate PDF files