I am having an issue with DOMPDF image loading. I tried all the way to load the image but it won't work on my local / server. isRemoteEnabled mode changed to true. I wanted to load a PNG image. Please help me if you have an idea of how to resolve this issue. I really appreciate any help you can provide. When i try this code am getting mem
Constructor:
$options = new Options();
$options->set('defaultFont', 'Helvetica');
$options->set('isRemoteEnabled', TRUE);
$options->set('debugKeepTemp', true);
$options->set('isHtml5ParserEnabled', true);
$this->dompdf = new Dompdf($options);
Fucntion :
$path = '../logo.png';
$type = pathinfo($path, PATHINFO_EXTENSION);
$data = file_get_contents($path);
$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
#data
$data = array_merge($this->data, [
'title' => $this->title,
'word' => $this->word,
'breadcrumb' => array("0" => array("url" => base_url("home"), "title" => 'Home'), "1" => array("url" => $url,
"title" => $this->word_multi)),
'action' => $url,
'customerID' => $cid,
'siteID' => $site,
'contractRow' => $contractRow,
'base64' => $base64
]);
#Contract file name
$contract = str_replace('/', "-", $contractRow['contractNumber']);
#remove UTF8 issue header
$this->response->removeHeader('Content-Type');
#viewpage data
$this->dompdf->loadHtml(view($this->path_views . 'contract', $data));
$this->dompdf->set_option('defaultMediaType', 'all');
$this->dompdf->setPaper('A4','portrait');
$this->dompdf->render();
$this->dompdf->stream( $contract, array("Attachment" => false));
View
<td width="20%"> <img src="<?php echo $base64; ?>" /></td>