title: dompdf generating damaged pdfs in codeigniter
body: <p>I am using dompdf for generating pdf in codeigniter application, 
  When I am opening pdf its giving error</p>
  
  <p><a href="https://i.stack.imgur.com/wOkPk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wOkPk.jpg" alt="enter image description here"></a>"</p>
  
  <p>I checked all stackoverflow stuffs for this,</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/32875865/corrupt-pdf-on-the-fly-attached-to-email-via-dompdf">Corrupt PDF on the fly attached to email via dompdf</a></li>
  <li><a href="https://stackoverflow.com/questions/20676160/cannot-open-pdf-file-generated-using-dompdf">cannot open pdf file generated using dompdf</a></li>
  <li><a href="https://stackoverflow.com/questions/5035112/generating-a-pdf-using-codeigniter">Generating a PDF using CodeIgniter</a></li>
  </ul>
  
  <p>and more,but no luck,
  my code is :</p>
  
  <pre><code>$html = file_get_contents(base_url() . "sampleHTMLfilepath");
  require_once("dompdf/dompdf_config.inc.php");
  if (is_null($this-&gt;_dompdf)) {
      $this-&gt;_dompdf = new DOMPDF();
  }
  $this-&gt;_dompdf-&gt;load_html($html);
  $this-&gt;_dompdf-&gt;render();
  $this-&gt;_dompdf-&gt;stream('test.pdf);
  </code></pre>
  
  <p>sample html is simple file with p tag </p>
  
  <pre><code>&lt;p&gt;Hello &lt;/p&gt;
  </code></pre>
  
  <p>Please help me,
  Thanks </p>