The need for PHP to generate PDF files is not uncommon;
Now that the integration is used, write a blog to explain it;
Sample project: Http://git.oschina.net/shuaibai123/thinkphp-bjyadmin
One: Introduce tcpdf
/thinkphp/library/vendor/tcpdf
Tcpdf the entire catalogue into its own project;
Two: function
/application/common/common/function.php
/** * generate PDF * @param string $html What needs to be generated */function pdf ($html = '
Three: How to use
All right, there's nothing to say;
More chestnuts:/thinkphp/library/vendor/tcpdf/examples
What needs to be noted is:
Can write HTML tags, such as the identification of the H tag font bold increase effect;
You can write style styles, but you can't fully support them;
Tcpdf's official website needs to bring a ladder: http://www.tcpdf.org
This article for Bai Jun Remote original article, reproduced without contact with me, but please specify from Bai Jun remote blog http://baijunyao.com