Thinkphp Integration Series of the Tcpdf class to generate PDF files

Source: Internet
Author: User

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:

    1. Can write HTML tags, such as the recognition of the H-tag font and increase the effect of bold;

    2. Can write style, but not fully supported;

    3. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.