Skip to content

Instantly share code, notes, and snippets.

Brian Sweeney bsweeney

Block or report user

Report or block bsweeney

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:7661613
$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);
You can’t perform that action at this time.