2017-10-16 65 views
2

我想利用細胞放置在不同位置的圖像插入多個圖片FPDF

這裏是我的代碼部分:

$x = $pdf->GetX(); 
$y = $pdf->GetY(); 

$pdf->SetXY($x, $y); 
$pdf->Cell(0, 0, $pdf->Image('../img/printing/LOGO.jpg',0,0,50,0,"","home.php"), 
     0, 'L'); //-->THIS PART IS WORKING 

$x = 160; 
$y = $y ; 
$pdf->SetXY($x, $y); 
$pdf->Cell(0, 0, 'asd', 0, 'L'); //-->THIS PART IS WORKING 

$x = 160; 
$y = $y; 
$pdf->SetXY($x, $y); 
$pdf->Cell(0, 0, $pdf->Image('../img/printing/LOGO.jpg',0,0,50,0,"","home.php"), 
     0, 'L'); //-->THIS PART IS NOT WORKING 
+0

也許你忘了'LOGOjpg'中的要點? –

+0

@KIKOSoftware我的不好,這是發佈時編輯代碼時的錯字。該代碼仍然無法正常工作。 – Kelpie

+0

是不是你的'$ x'和'$ y'總是一樣的? '$ y = $ y'沒用。 – Justinas

回答

0

所以,我必須解決這個問題$pdf->Cell(0, 0,asd $pdf>Image('../img/printing/LOGO.jpg', 0,0,50,0,"","home.php"),0,'L');不繼的當前位置細胞。所以我必須將它與當前位置相匹配。 $pdf->Cell(0, 0,asd $pdf>Image('../img/printing/LOGO.jpg', 160,0,50,0,"","home.php"),0,'L');在以下代碼的完整部分

$x = 160; 
$y = $y; 
$pdf->SetXY($x, $y); 
$pdf->Cell(0, 0, $pdf->Image('../img/printing/LOGO.jpg',160,0,50,0,"","home.php"), 
     0, 'L'); //-->THIS PART IS NOT WORKING