pdf->SetDisplayMode('fullpage'); ob_start(); include dirname(__FILE__).'/search.php'; $content = ob_get_clean(); $html2pdf->writeHTML($content); $html2pdf->output('about.pdf'); } catch (Html2PdfException $e) { $html2pdf->clean(); $formatter = new ExceptionFormatter($e); echo $formatter->getHtmlMessage(); } ?>