1

I'm generating PDF using TCPDF but when get to display the multiple images from database in PDF, images not showing. When print_r(html);exit;, images path calling properly but not appearing.

<?php 
      $defect_photos =explode (',',$data['data']['defect_photo']);  
      $html = '<table border=1>';$link = base_url(); 
      foreach($defect_photos as $defect_photo){  
         $html .= "<tr><td><img src='$link/uploads/defects/$defect_photo'></td></tr>";
      }
      $html .= '</table>'; $pdf->writeHTML($html, true, false, true, false, ''); 
?>
M N
  • 69
  • 2
  • 14
  • What happens if you add a dot behind `$defect_photo`? – Nico Haase Apr 20 '18 at 09:59
  • Possible duplicate of [PHP parse/syntax errors; and how to solve them?](https://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them) – Nico Haase Apr 20 '18 at 10:00
  • Parse error: syntax error, unexpected '"'>"' I'm getting this error. @NicoHaase – M N Apr 20 '18 at 10:14
  • I'm getting an image when `print_r($defect_photo)` the output but not showing in the pdf page. – M N May 21 '18 at 07:02

0 Answers0