0

I have trouble displaying image (or this time is photo) using mc table FPDF.

This is a little of my script:

$pdf=new PDF_MC_Table();
$pdf->SetWidths(array(30,10,30,230));
$pdf->SetAligns(array('L','L','L','C'));
$pdf->Row(array($name, $age, $gender, $photo));
$pdf->Output();

$photo fill with location of image that I want to display in my PDF table.

The image does not show up at all, instead it shows text of that location

Alfabravo
  • 7,493
  • 6
  • 46
  • 82
Hendri P
  • 31
  • 5

1 Answers1

1

I already got the answer

in mc_table.php I add this

...
function Row($data)
{
  ...
  for($i=0;$i<count($data);$i++)
  {
    ...
    if(substr($data[$i],-3) == 'jpg' || substr($data[$i],-3) == 'png')
    {
      $ih = $h - 0.5;
      $iw = $w - 0.5;
      $ix = $x + 0.25;
      $iy = $y + 0.25;
      //show image
      $this->MultiCell($w,5,$this->Image ($data[$i],$ix,$iy,$iw),0,$a);
    }else
    {
      //Print the text
      $this->MultiCell($w,5,$data[$i],0,$a);
    }
  ...
  }
}
Hendri P
  • 31
  • 5