我认为与页眉/页脚无关,但我认为 TCPDF 有错误,多次加载相同图像文件会破坏图像功能,如此处报告的TCPDF - 图像仅显示一次
实际版本 tecnickcom/tcpdf:6.2.26 上也存在该错误
我通过在外部加载图像并将其作为字符串传递给函数来解决此问题。
public function Header()
{
$this->Image('@'.file_get_contents('/home/xxxxxx/public_html/xxxxxxxx/uploads/logo/logo.png'),10,6,0,13);
$this->SetFont('helvetica','B',20);
$this->Cell(80);
$this->Cell(0,0, $project->name . ' - Project Plan',$frame,0,'R');
$this->Ln(8);
$this->SetFont('helvetica','',10);
$this->Cell(0,0, $organisation->name,$frame,0,'R');
$this->Ln(10);
}