How to put HTML data into header of tcpdf?

前端 未结 3 1221
小蘑菇
小蘑菇 2021-02-04 09:35

I\'m using the tcpdf library to generate the pdf document. I\'m using smarty template engine to hold the data. Below is the script to put in the header data:

//          


        
3条回答
  •  没有蜡笔的小新
    2021-02-04 10:17

    You must instance your PDF class and extend the TCPDF class. After your PDF class should look like this:

    class MyTCPDF extends TCPDF{
      public function Header(){
         $html = '...
    '; $this->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'top', $autopadding = true); } }

    You must adapt this to your own project.

提交回复
热议问题