I\'m using the mPDF library to generate PDF docs directly from HTML output. The problem is that this mPDF library is written as it is and it is generating dozens of notices
If you use $mpdf->Output() after ob_end_clean(), you can even display the PDF without notices in the browser! I use this in OpenCart. But you need to use ob_start() and ob_end_clean().