below code used for generating for pdf.
$html== this variable store some html pages
$this->mpdf = new mPDF();
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.