I have been trying to get page numbers in the footer of my document without any luck. I am using dompdf 0.8.2.
My instantiation code is:
$dompdf = new Dompdf();
$options = new \Dompdf\Options();
$options->set('isPhpEnabled', true);
$options->set('defaultFont','Helvetica');
$dompdf->setOptions($options);
My inline php is:
Enter <script type="text/php">
if (isset($pdf))
{
$x = 760;
$y = 561;
$text = "Page {PAGE_NUM} of {PAGE_COUNT}";
$font = $fontMetrics->get_font("Helvetica", "bold");
$size = 8;
$color = array(0,0,0);
$word_space = 0.0;
$char_space = 0.0;
$angle = 0.0;
$pdf->page_text($x, $y, $text, $font, $size, $color, $word_space, $char_space, $angle);
}
</script>
I output my PDF with:
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
$dompdf->stream('gtwbimport'.$filedate.'.pdf');
The $html variable is generated dynamically in the script (with values from a database, etc).
The PDF is generated and displayed but there is no footer with the page number, etc.
I have tried to look at the samples mentioned in the documentation (that are in the test/ directory) but I don't have a test directory nor can find any release of 0.8.x with it.