【发布时间】:2014-03-14 06:56:51
【问题描述】:
我想使用 PHP 创建 PDF,为此我使用 FPDF。现在我想在 PDF 顶部添加两个图像(一个在左角,一个在右角)。我为此使用以下代码,
代码:-
function Header () {
$this->Image('logo.png',10,20,33,0,'','http://www.fpdf.org/');
$this->SetFont('Arial', 'B', 20);
$this->SetFillColor(36, 96, 84);
$this->SetTextColor(28,134,238);
$this->Cell(0, 10, "Your Car Comparison Document", 0, 1, 'C', false);
$this->Cell(0, 5, "", 0, 1, 'C', false);
$this->Cell(0, 10, "Thanks for visiting CarConnect.", 0, 1, 'C', false);
$this->Cell(0, 5, "", 0, 1, 'C', false);
}
但是当我添加图像代码时,它会在浏览器上显示 404 错误,否则它可以正常工作。
【问题讨论】: