I have made a PDF exporter, which takes data from a model and export it in PDF by FPDF library.
$pdf = new FPDF();
$pdf->AddPage();
foreach ( $finalData AS $finalRow )
{
foreach($finalRow as $one)
{
$pdf->SetFont("Arial", "", "8");
$pdf->Cell(18, 5, $one, 1, 0, "C");
}
$pdf->Ln();
}
$pdf->Output();`
But I have too much info and the only way that my info would not go from Cell borders is to make that my cell width would be equal to text (because in some columns there are short text and in some are long). Does anyone have a clue how doing this???
Do you want FPDF::GetStringWidth
?