Q:

Adding cover image with page number in dompdf

I have successfully implemented dompdf for generating PDF files. Now I
want to add paging in footer but I want that page number start with> 2nd page because in the first page I place cover image so counting should start with the 2nd page how can I customize this code 
$pdf->page_text(500,10, "Page: {PAGE_NUM} of {PAGE_COUNT}", $font, 6,array(0,0,0));

because this start paging on all pages but i don't want to include
first page.

A:

For page number just add few lines of code:
$pdf=$dompdf->get_canvas();
if ( isset($pdf) ) {

    $pdf->page_script('
        if ($PAGE_NUM > 1) {
            $PAGE_NUM=$PAGE_NUM-1;
            $PAGE_COUNT=$PAGE_COUNT-1;
            $font = Font_Metrics::get_font("Arial, Helvetica, sans-serif", "normal");
            $size = 12;

            $pageText1 =  " Page " ;
            $y1 = $pdf->get_height() - 34;
            $x1 = $pdf->get_width() - 15 - Font_Metrics::get_text_width($pageText1, $font, $size);
            $pdf->text($x1, $y1, $pageText1, $font, $size);

            $pageText = $PAGE_NUM . " of " . $PAGE_COUNT;
            $y = $pdf->get_height() - 20;
            $x = $pdf->get_width() - 15 - Font_Metrics::get_text_width($pageText, $font, $size);
            $pdf->text($x, $y, $pageText, $font, $size);
        }
    ');
}

