我想使用PHP創建PDF,爲此我使用FPDF。現在我想在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錯誤它工作正常。
在同一個文件夾中有一個圖像(logo.png)我也把圖像的完整url,但我面臨同樣的問題。 –