Vendor('mpdf.mpdf');
$mpdf = new \mPDF('utf-8', 'A4', 16, '', 10, 10, 15, 1);
$mpdf->SetDisplayMode('fullpage');
$mpdf->autoScriptToLang = true;
$mpdf->autoLangToFont = true;
$html = <<<EOT
<html>
<body>
<h1>要生成的</h1>
</body>
</html>
EOT;
$mpdf->WriteHTML($html, 2);
$fileName = iconv("utf-8","gb2312",time()).".pdf";
$user_thumb = '../Uploads/Pdf/'.$fileName;
$mpdf->Output($user_thumb,'f'); //D是下载
mpdf下载地址:https://github.com/mpdf/mpdf/archive/development.zip