2014-10-30 36 views
0

我正在使用TCPDF生成PDF文檔。我遇到的問題是我試圖在每頁上添加一個不同的頁腳。顯然,TCPDF僅爲單個頁腳提供瞭解決方案。TCPDF多頁腳

每個頁腳只包含基本的html代碼,沒有任何樣式。

任何想法?

+0

你試過了什麼?提供一些代碼...來吧...你不是新來的,所以你現在應該知道更多... – 2014-10-30 16:24:24

回答

0

您可以打開默認頁腳像這樣:

$pdf->SetPrintFooter(false); 

創建自己的一個是這樣的:

$footer = 'yau man footer stuff'; 

,然後創建自己的頁腳功能:

public function _footer($input) { 
    $text = $input; 

    $pdf->setY(-15); // or whatever location your footer should be displayed. 

    $pdf->Cell (// or another method like Write(), WriteHTML() .. 
     $width = 0, // width of the cell, not the input 
     $height = 0, // height of the cell.. 
     $x, 
     $y, 
     $text = '', // your input. 
     $border = 0, 
     $ln = 0, 
     $fill = false, 
     $reseth = true, 
     $align = '', 
     $autopadding = true 
    ); 
} 

通過調用$ pdf - > _ footer($ footer);你創建自己的頁腳

+0

輸出是一個空白頁面 – Jarla 2017-03-02 10:52:21