イメージと詳細の両方が並べて表示されるように、イメージを含むセルを、イメージに関連する詳細を含むマルチセルと整列させようとしています。Webを検索した後、私はそれを行ういくつかの方法を見つけました。(データベースから詳細を呼び出しました):
$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times','',12);
$image_height = 37;
$image_width = 37;
foreach($inventories as $key => $inventories) :
$image = $inventories['image'];
$resourceID = $inventories['resourceID'];
$learningcentre = $inventories['learningcentre'];
$title = $inventories['title'];
$quantity = $inventories['quantity'];
$description = $inventories['description'];
$pdf->Cell( 40, 20, $pdf->Image($imagesDirectory.$image, $pdf->GetX(), $pdf->GetY(), $image_height, $image_width), 0, 0, 'L');
$pdf->MultiCell(140,8,$resourceID."\n".$title."\n".$learningcentre."\n".$quantity."\n".$description, 1,1);
$pdf->Ln();
endforeach;
ただし、結果がページの最後に達すると、下の図に示すように、画像が途切れて詳細セルが次のページにプッシュされます。
私は FPDF を初めて使用し、解決策を探していましたが、役に立ちませんでした。どんな助けでも大歓迎です.Thanks!