将页脚连接到tcpdf中每个页面的最底部

Muh*_*aib 16 tcpdf yii

我需要在每页的最底部附上页脚.我使用tcpdf生成pdf.我在谷歌尝试了很多解决方案,但没有找到任何运气.我目前的框架是yii,我正在使用tcpdf扩展.

Vic*_*663 8

例如,你需要在你的类中编写Footer方法

// Page footer
public function Footer() {
    // Position at 15 mm from bottom
    $this->SetY(-15);
    // Set font
    $this->SetFont('helvetica', 'I', 8);
    // Page number
    $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
Run Code Online (Sandbox Code Playgroud)