Generate your html whatever way you like and use the following.
require_once("/Path/To/dompdf/dompdf_config.inc.php");
$dompdf = new DOMPDF();
$dompdf->load_html($MyValidHtml);
$dompdf->set_paper('A4');
$dompdf->render();
//Either output to file
$output = $dompdf->output();
file_put_contents('test.pdf', $output);
//Or to the browser
$dompdf->stream('test.pdf', array("Attachment" => false));