vikrambalye / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

$PAGE_NUM and $PAGE_COUNT #458

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
$PAGE_NUM and $PAGE_COUNT both are giving null value .

i want to know current page number and store it in new variable so i can use it 
for other purpose. 

i am using dompdf_0-6-0_beta3 .and PHP 5.2 on window XP.

code:
<?php 
if (isset($pdf) ) {
    echo $PAGE_COUNT; 
}
?>
this code is not giving me any value.
but before this code i am using 

if ( isset($pdf) ){ 
          $font = Font_Metrics::get_font("helvetica", "normal"); 
          $pdf->page_text(472, 18, "Page: {PAGE_NUM} of {PAGE_COUNT}", $font, 8,array(0,0,0)); 

        } </script>

and its working is fine.

Original issue reported on code.google.com by amitpraj...@gmail.com on 2 Apr 2012 at 12:58

GoogleCodeExporter commented 9 years ago
PAGE_NUM and PAGE_COUNT are more like template variables and so are not 
available to PHP. However, you can retrieve the page count from the canvas 
object like so:

    $dompdf->get_canvas()->get_page_count()

Original comment by eclecticgeek on 2 Apr 2012 at 3:30

GoogleCodeExporter commented 9 years ago
Thank you very much for your reply .

but still my problem is not solved .

my motive is find out when second page start because i want to print something 
when 
second page start .

Original comment by amitpraj...@gmail.com on 3 Apr 2012 at 5:11

GoogleCodeExporter commented 9 years ago
see issue 459 for follow-up

Original comment by eclecticgeek on 3 Apr 2012 at 2:07

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:16