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.