Я пытаюсь сделать следующий макет в файле PDF, сгенерированном FPDF в PHP.FPDF align with Image and Cell
--------------------------------------------------
| | Text1 |
| IMAGE | Text2 |
| | Text3 |
--------------------------------------------------
Но я не мог понять, как это сделать к настоящему времени.
Это код, я использую
public function floatingImage($imgPath, $height) {
list($w, $h) = getimagesize($imgPath);
$ratio = $w/$h;
$imgWidth = $height * $ratio;
$this->Image($imgPath, $this->GetX(), $this->GetY(), 140, 100);
$this->x += $imgWidth;
}
/* Logbuch is our extension from FPDI, but there's nothing changed
* only a custom header, footer and the floatingImage and loadMapImage function are part of it
*/
$pdf = new logbuch();
// Frontpage
$pdf->AddPage();
$mapImage = $pdf->loadMapImage();
$pdf->setJPEGQuality(75);
$x = 15; $y = 21; $w = 100;
$pdf->floatingImage($mapImage, 100, 100);
$pdf->SetFillColor(154,222,229);
$pdf->Cell(0,0,"Test",0,0,'R',true);
$pdf->Ln();
$pdf->Cell(100,0,"Test",0,0,'R',true);
$pdf->Ln();
$pdf->Cell(100,0,"Test",0,0,'R',true);
Это результат я генерации к настоящему времени
Если изменить ширину двух последних ячеек до 100 это будет выглядеть так:
Это почти, что я хочу, ячейки просто должны совпадать с правой стороной. Как я могу это сделать?