将底部的页脚附加到 tcpdf 中的每一页 [英] Attach footer at very bottom to every page in tcpdf

查看:36
本文介绍了将底部的页脚附加到 tcpdf 中的每一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I need to attach footer at the very bottom of every page. I am using tcpdf for generating pdf's. i tried many solution on google but did not found any luck. My current framework is yii and i am using tcpdf extension.

推荐答案

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

you need to write Footer method in your class for example

// 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');
}

这篇关于将底部的页脚附加到 tcpdf 中的每一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆