Typically you would add some inline script to your HTML document prior
to rendering it with DOMPDF. See the FAQ (
http://code.google.com/p/
dompdf/wiki/FAQ). Note that this script should appear within the body
tag of the document, and probably as the first element within the body
if you want to make sure it affects every page.
If, for some reason, it isn't possible to add this code to your HTML
document, you could use some basic string replacement to insert it
before rendering with DOMPDF. Something like:
$script = '<script type="text/php">
if ( isset($pdf) ) {
$font = Font_Metrics::get_font("verdana", "bold");
$pdf->page_text(72, 18, "Header: {PAGE_NUM} of {PAGE_COUNT}", $font,
6, array(0,0,0));
}
</script>';
$html = str_replace('<body>', '<body>'.$script, $html);