page number problem

80 views
Skip to first unread message

ferytino

unread,
Dec 5, 2011, 8:29:00 PM12/5/11
to dompdf
Hi there,

I just create simple php code to test put page number on my pdf
document but still not working. I set and check my dompdf config for
variable DOMPDF_ENABLE_PHP is already true

below are my simple code:
<?php
$dompdf = new DOMPDF();
$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>
Hello World!
</body>
</html>
";
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("test.pdf", array("Attachment" => false));
?>

may somebody can advise me to solve this problem.

Thank in Advance

BrianS

unread,
Dec 5, 2011, 8:34:21 PM12/5/11
to dom...@googlegroups.com
Your inline script should be in the body of your document. Scripts in the head are currently discarded. 

ferytino

unread,
Dec 6, 2011, 5:34:41 AM12/6/11
to dompdf
Hi BrianS,

Yes! You are right.... my problem solved.

Many Thanks,
Ferytino

Reply all
Reply to author
Forward
0 new messages