title: PDF generation using DOMpdf in CodeIgniter
body: <p>I am trying to generate a pdf using dompdf. </p>
  
  <pre><code> &lt;?php
  
  if (!defined('BASEPATH'))
      exit('No direct script access allowed');
  
  class Dompdf_test extends CI_Controller {
  
      public function index() {
          // Load all views as normal
          //$this-&gt;load-&gt;view('phptopdfexample');
          $this-&gt;all_movements();
          // Get output html
          $html = $this-&gt;output-&gt;get_output();
  
          // Load library
          $this-&gt;load-&gt;library('dompdf_gen');
  
          // Convert to PDF
          $this-&gt;dompdf-&gt;load_html($html);
  
          $this-&gt;dompdf-&gt;render();
          $min = 1;
          $max = 1000;
          $name = rand($min, $max);
          $this-&gt;dompdf-&gt;stream($name . '.pdf');
      }
  
      public function all_movements() {
          $data['stocks'] = $this-&gt;inventory-&gt;getdepartmentalmovements();
          $data['meds'] = $this-&gt;inventory-&gt;get_meds();
  
          $this-&gt;load-&gt;view('deptartmental_issue_pdf', $data);
      }
  
  }
  </code></pre>
  
  <p>When I run the  script, I get an internal server error with the following error : 
  A PHP Error was encountered</p>
  
  <p>Severity: Warning</p>
  
  <p>Message: Illegal string offset 'hex'</p>
  
  <p>Filename: include/style.cls.php</p>
  
  <p>Line Number: 1422</p>
  
  <p>How can I solve this problem? </p>