Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bsweeney's full-sized avatar
🙀

Brian Sweeney bsweeney

🙀
View GitHub Profile
@bsweeney
bsweeney / gist:7661613
Last active December 29, 2015 11:09 — forked from anonymous/gist:7661439
$dompdf = new DOMPDF;
$dompdf->load_html('<p>hello world</p><p style="page-break-before: always;">hello again</p>');
$dompdf->get_canvas()->page_script('
if ($PAGE_COUNT > 1) {
$font = Font_Metrics::get_font("yourfont", "normal");
$size = 9;
$pageText = "Page " . $PAGE_NUM . " of " . $PAGE_COUNT;
$y = $pdf->get_height() - 24;
$x = $pdf->get_width() - 15 - Font_Metrics::get_text_width($pageText, $font, $size);
$pdf->text($x, $y, $pageText, $font, $size);