Thinkphp Integration series of Tcpdf class to generate PDF files

Source: Internet
Author: User

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


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.