Answers for "datatable pdf export with image"

0

datatable pdf export with image

Plain text
1
2
3
4
5
6
7
8
$path = $image; //this is the image path
$type = pathinfo($path, PATHINFO_EXTENSION);
$data = file_get_contents($path);
$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
 
echo '<td >
  <img class="img-fluid" src="'.$base64.'" style="max-height:100px;"></td>';
  //every image is displayed correctly in my table
Posted by: Guest on October-25-2021
0

datatable pdf export with image

Plain text
1
2
3
4
5
6
7
8
$path = $image; //this is the image path
$type = pathinfo($path, PATHINFO_EXTENSION);
$data = file_get_contents($path);
$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
 
echo '<td >
  <img class="img-fluid" src="'.$base64.'" style="max-height:100px;"></td>';
  //every image is displayed correctly in my table
Posted by: Guest on October-25-2021

Browse Popular Code Answers by Language