title: How to convert view to pdf in php codeigniter using mpdf?
body: <p>As I am new to CodeIgniter, I am trying to convert a view to PDF using <code>mpdf</code>, but I am getting following error : </p>
  
  <blockquote>
    <p>Call to undefined function mb_internal_encoding()</p>
  </blockquote>
  
  <p>And the code in my controller file is:</p>
  
  <pre><code>public function DownloadPDF()
  {
     $this-&gt;load-&gt;library('M_pdf');
     $data =array('id'=&gt;'1',
                  'name'=&gt;'test'
                 );
     $html=$this-&gt;load-&gt;view('user/Invoice', $data, true); 
     $pdfFilePath ="mypdfName-".time()."-download.pdf";
     $pdf = $this-&gt;M_pdf-&gt;load();
     $pdf-&gt;WriteHTML($html,2);
     $pdf-&gt;Output($pdfFilePath, "D");
  }
  </code></pre>
  
  <p>Please, can anyone help me to solve this error?</p>
  
  <p>Thanks in advance!</p>