I cannot seem to figure out how to get page numbers working.
I set the constant DOMPDF_ENABLE_PHP to true. Then, I have been
trying to use the example on this page:
http://code.google.com/p/dompdf/wiki/FAQ
. It just isnt working. Is there an example of a working document
with page numbers that I can see somewhere?
Here is my code:
<?php
require_once("../../libraries/dompdf/dompdf_config.inc.php");
$html = '
<html>
<head>
<script type="text/php">
if ( isset($pdf) ) {
$font = Font_Metrics::get_font("helvetica", "bold");
$pdf->page_text(72, 18, "Header: {PAGE_NUM} of
{PAGE_COUNT}", $font, 6, array(0,0,0));
}
</script>
</head>
<body>
my document here...
</body>
</html>';
$dompdf = new DOMPDF();
$dompdf->set_paper("a4", "landscape" );
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("dompdf_out.pdf", array("Attachment" => false));
?>