title: mpdf error - preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
body: <p>i'm using MPDF to generate pdf files in codeigniter.</p>
  
  <p>my controller function look like</p>
  
  <pre><code>   function save_pdf($std_id)
     {
       $data['section1_report']= $this-&gt;common_model-&gt;get_details('tbl_section1',array('id'=&gt;$std_id));
       $html = $this-&gt;load-&gt;view('reports/section1',$data,true);
        // print_r($html);exit; 
       $this-&gt;load-&gt;library('pdf');
       $pdf = $this-&gt;pdf-&gt;load();
       $pdf-&gt;WriteHTML($html);
       $pdf-&gt;Output();
  }
  </code></pre>
  
  <p>my <code>pdf</code> library is</p>
  
  <pre><code> &lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');
     class pdf {    
        function pdf()
        {
           $CI = &amp; get_instance();
           log_message('Debug', 'mPDF class is loaded.');
        }
  
       function load($param=NULL)
       {
           include_once APPPATH.'/mpdf/mpdf.php';         
           if ($params == NULL)
           {
               $param = '"en-GB-x","A4","","",10,10,10,10,6,3';         
           }         
         return new mPDF($param);
       }
    }
  </code></pre>
  
  <p>i want to generate pdf file from the view file <code>section1</code>. but when i call the controller function <code>save_pdf</code> , i got the errors as below</p>
  
  <p><img src="https://i.stack.imgur.com/y1Sh1.png" alt="enter image description here"></p>
  
  <p>when i <code>print_r($html);exit;</code> , it displays all the contents from the view file.i used <code>preg_replace_callback</code> instead of <code>preg_replace</code> in <code>mpdf/includes/functions.php</code> but it's still showing error like this</p>
  
  <p><img src="https://i.stack.imgur.com/dKd88.png" alt="enter image description here"></p>
  
  <p>i studied the <code>mpdf</code> documentation and it's working correctly in plain php. but i want to generate pdf file in <code>Codeigniter</code>.
  how to solve such errors in <code>mpdf</code>? I would appreciate any help where i can generate <code>pdf file</code> using <code>mpdf</code> in <code>Codeigniter</code>. thank you.</p>