【问题标题】:fpdf : increase size of footer and add multiple lines in pdffpdf : 增加页脚的大小并在 pdf 中添加多行
【发布时间】:2023-10-10 19:19:01
【问题描述】:

我正在使用 FPDF 生成报告。

我想在页脚中放入大量数据。即三个人的姓名和签名

我希望它位于多行。

问题:它一直被推到焦点之外。没有到下一页,但是一旦到达页面底部附近就看不到它了。

另外,如果显示,它只会在页面末尾显示一次...

如何增加页脚的大小?

这是我的页脚代码

 function Footer() {
    $date=date(' jS  F Y ');
    $this->Cell(-28,150,$date,10,0,'C');
    $this->Cell(-190,150,$date,10,0,'C');
    $this->Cell(-50,150,$date,10,0,'C');

    $this->Cell(75,130,'The Village Market Representative',10,0,'C');
    $this->Cell(195,130,'Betting Control and licensing Board Representative',10,0,'C');
    $this->Cell(-55,130,'Witness',10,0,'C');
 }

我将如何做到这一点,以便在每个页面上都有它并且不会让我的页脚超出焦点?

【问题讨论】:

    标签: php pdf-generation fpdf


    【解决方案1】:

    在写出单元格之前尝试使用 setY() 将光标位置设置在页面底部上方:

    function Footer() {
        $this->setY(-30); 
        $date=date(' jS  F Y ');
        $this->Cell(-28,150,$date,10,0,'C');
        $this->Cell(-190,150,$date,10,0,'C');
        $this->Cell(-50,150,$date,10,0,'C');
    
        $this->Cell(75,130,'The Village Market Representative',10,0,'C');
        $this->Cell(195,130,'Betting Control and licensing Board Representative',10,0,'C');
        $this->Cell(-55,130,'Witness',10,0,'C');
     }
    

    我在网上看到的大多数示例都使用 setY() 设置页脚使用 (-15),但这似乎总是将页脚推到下一页,所以我将负值设置得更高。负值设置基于页面底部的 Y 位置。

    【讨论】:

      最近更新 更多