【问题标题】:FPDF : set position from inner pageFPDF:从内页设置位置
【发布时间】:2022-01-21 09:47:16
【问题描述】:

使用 fpdf 来创建我的文档,它可以完美地工作,但只有一件事。在页脚部分有一个单行叠加。

这是我的 Pdf 类头函数:

function Header() {
  $this->setY(40);
  $titre="MY TITLE";
  $this->SetFont('Arial','B',16);
  .....
  doing all my stuff
  .....
  $this->Ln();
}

这是 Footer 方法:

function Footer() {
   $this->SetY(-25); --postionning footer at 2.5 cm from the bottom
   ....
   doing my stuff
}

调用程序:

$pdf = new Pdf();
$pdf->Open();
$pdf->addPage();
$request= "SELECT.....";
$result = $link->query($request) ; 
while($row=$result->fetchRow()) {
   $pdf->SetX(18);
   foreach($row as $champ=>$valeur) {
     ....
     displaying the fields in the document
     ...
   }
   $pdf->Ln();
}

我的问题:它显示的 1 行过多,与页脚重叠。

我想在页脚和内页之间给出一个位置。这可能吗?

谢谢

【问题讨论】:

  • 您应该删除对 Open() 的调用,该调用现已弃用。

标签: php pdf fpdf


【解决方案1】:

使用SetAutoPageBreak()方法增加下边距,例如:

$pdf = new Pdf();
$pdf->SetAutoPageBreak(true, 40);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-29
    • 1970-01-01
    • 2021-12-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多