Generate PDF from HTML
<?php
$html = ("<html>");
$html .= ("<head>");
$html .= ("<style>");
$html .= ("</style>");
$html .= ("</head>");
$html .= ("<body>");
$html.=("<table width='500' border='1' cellspacing='1' cellpadding='1'>\n");
$html .= ("<tr>");
$html .= ("<td>hello</td>");
$html .= ("<td>welcome</td>");
$html .= ("</tr>");
$html .= ("</table>");
$html .= ("<h2>Generated PDF</h2>\n");
$html .= ("<p>date_today</p>\n");
$html .= ("</div>");
$html .= ("<p>$table->COMMENT</p>\n");
$html .= ("</body>");
$html .= ("</html>");
function render($html,$filename)
{
require_once("../dompdf_config.inc.php");
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->set_paper("a4", "landscape" );
$dompdf->render();
$dompdf->stream("$filename.pdf");
}
$filename = ("GeneratedPDF");
render($html,$filename);
?>