Пожалуйста, попробуйте ниже код, он работает для меня.Но я использовал TCPDF
$pdf=new mPDF('c', 'A4-L');
$pdf->AddPage();
// FETCH HTML
ob_start();
include_once(CONTENT_PATH."filename.php");
$rpcontent=ob_get_contents();
ob_end_clean();
// FETCH HTML
$htmlcontent = $rpcontent;
// output the HTML content
$pdf->writeHTML($htmlcontent, true, 0, true, 0);
$pdf->lastPage();
$pdf->Output($pdf_file, "I"); // I for sending the file inline to the browser
$pdf->Output(REPORT_PATH.test.pdf, "F"); //F for saving output to file