I am using dompdf for generating pdf in codeigniter application, When I am opening pdf its giving error
I checked all stackoverflow stuffs for this,
- Corrupt PDF on the fly attached to email via dompdf
- cannot open pdf file generated using dompdf
- Generating a PDF using CodeIgniter
and more,but no luck, my code is :
$html = file_get_contents(base_url() . "sampleHTMLfilepath");
require_once("dompdf/dompdf_config.inc.php");
if (is_null($this->_dompdf)) {
$this->_dompdf = new DOMPDF();
}
$this->_dompdf->load_html($html);
$this->_dompdf->render();
$this->_dompdf->stream('test.pdf);
sample html is simple file with p tag
<p>Hello </p>
Please help me, Thanks