Placing two MultiCells side by side using FPDF in PHP

I am trying to create a custom table using FPDF Cell / MultiCell.

My MultiCell cell is a MultiCell with two lines of text. The next cell should be placed right next to it.

Problem : no matter what I do with the next cell, it is always on the next line of the page, and not next to the first cell - and it drives me crazy.

Here is my code:

 require_once 'config.php'; require 'fpdf.php'; $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','',10); $pdf->MultiCell(150,10,'Certificate of foreign Currency usage in respect of materials and components in terms of the notes to rebate item ',1); $pdf->SetFont('Arial','',10); $pdf->MultiCell(40,10,'DA190',1); $pdf->Output(); 

The cell containing the text "DA190" must be located next to the previous cell, but located below the previous cell.

+5
source share
3 answers

Before printing the first multi-core book, write down the cursor position:

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

add a plurality using $this->Multicell($w,5,'Content');

Reset cursor position to initial height (y) and initial horizontal + width of the 1st multicell system:

 $this->SetXY($x+$w,$y); 

Add the following multiple set and repeat if necessary.

+10
source

it worked for me

 $pdf->multicell(120, 5, ' ' . $actividad, 0, 'l', true); $x = $pdf->GetX(); $y = $pdf->GetY(); $pdf->SetXY($x + 120, $y); $pdf->Cell(70, -5, ' ' . $claseActividad, '', 0, 'l', true); 

result

0
source

I found a solution - fpdf has an extension (# 3) focused on using multi-cell files.

-4
source

All Articles