PDF creation using mpdf library is throwing error in codeigniter.

By | December 7, 2015

below code used for generating for pdf.
$html== this variable store some html pages
$this->load->library(‘mpdf’);
$this->mpdf = new mPDF();
$this->mpdf->WriteHTML($html, 2);
$this->mpdf->Output($file_name, ‘D’);

if we print the html content it is displaying proper means there is no error until the pdf generation.

you can use the below code to debug the issue.

$mpdf->debug = true;
after adding the above code, if it is showing any error it is related to the code for generating
html.even some spaces in html also will create the pdf generation issue.

  • Rajendra

    Hi
    I m getting a blank screen in the browser after executing the pdf creation code..can you help me on this.
    Thanks
    Rajendra

    • Vasanthan pv

      Hi

      just add the below lines of code

      ini_set(“memory_limit”, “999M”);

      ini_set(“max_execution_time”, “999”);