Answers for "display picture in pdf generated with laravel"

PHP
0

display picture in pdf generated with laravel

//in Controller    
        $path = 'images/V.png';
        $type = pathinfo($path, PATHINFO_EXTENSION);
        $data = file_get_contents($path);
        $logo = 'data:image/' . $type . ';base64,' . base64_encode($data);
  //in View
         <img src="{{ $data['logo'] }}" width="150" height="150" />
Posted by: Guest on December-10-2020

Browse Popular Code Answers by Language