DOMPDF Page numbers
-
Hi,
We have orders printing to a zebra label printer via our woocommerce and a plugin called print orders, we are trying to add pages numbers to the label using dompdf, I have searched the forums and found the code but do not know where to put it, I have tried google cloud plugin header as it is type/php, I have tried functions.php and tried the template file from the plugin but it does not work.
Any advice this is the code below
<script type=”text/php”>
if ( isset($pdf) ) {
$pdf->page_script(‘
if ($PAGE_COUNT > 1) {
$font = Font_Metrics::get_font(“Arial”, “normal”);
$size = 7;
$pageText = “Page ” . $PAGE_NUM . ” of ” . $PAGE_COUNT;
$y = $pdf->get_height() – 80;
$x = ($pdf->get_width() – Font_Metrics::get_text_width($pageText, $font, $size) ) / 2 ;
$pdf->text($x, $y, $pageText, $font, $size);
}
‘);
}
</script>
- The topic ‘DOMPDF Page numbers’ is closed to new replies.