TCPDF多页脚 [英] TCPDF Multiple Footers

查看:169
本文介绍了TCPDF多页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用TCPDF生成PDF文档.我的问题是我试图为每页添加一个不同的页脚.显然,TCPDF仅为单个页脚提供了一种解决方案.

I am using TCPDF to generate PDF documents. The problem I have is that I am trying to add a different footer per page. Apparently, TCPDF provides a solution only for a single footer.

每个页脚仅包含基本的html代码,没有任何样式.

Each footer contains only basic html code without any styling.

有什么想法吗?

推荐答案

您可以像这样打开默认页脚:

You can turn of the default footer like this:

$pdf->SetPrintFooter(false);

像这样创建自己的一个:

create your own one like this:

$footer = 'yau man footer stuff';

,然后创建自己的页脚函数:

and then create your own footer function:

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);您创建自己的页脚

by calling $pdf->_footer($footer); you create your own footer

这篇关于TCPDF多页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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