i making pdf of invoices multiple companies. every company has own logo want going on pdf. using dompdf sake of pdf generation. when hard code value of src attribute relative path of image rendered fine on pdf. eg in codeigniter:
$this->load->helper(array('dompdf', 'file')); $html = '<img style = "height: 140px; width: 180px;" src = "images/logo.png" />'; pdf_create($html, 'filename'); $data = pdf_create($html, '', false); now, image's relative path going change everytime depending on client logged in trying give src attribute dynamic value such:
$this->load->helper(array('dompdf', 'file')); $html = '<img style = "height: 140px; width: 180px;" src = '; $row->img; $html.=' />'; pdf_create($html, 'filename'); $data = pdf_create($html, '', false); where $row->img has value = images/logo.png case.(the value going change depending on logged in).
using above code gives me blank space on pdf, not broken image neither error message. please me taken 1 day of mine.
comments, suggestions, answers highly appreciated again.
try this:
$html = '<img style = "height: 140px; width: 180px;" src ="'.$row->img.'"/>';
Comments
Post a Comment