Reputation: 157
How can I make the page numbering centered instead of right alignment? This is how I added the page numbering:
include("mpdf60/mpdf.php");
$mpdf=new \mPDF('c','A4','','' , 0, 0, 0, 0, 0, 0);
$mpdf->setFooter('{PAGENO} of {nbpg}');
$mpdf->WriteHTML($body);
$mpdf->Output('Packing Slip.pdf','I');
How can I make it center? its the 'setFooter' ? Im am using mpdf.
Upvotes: 3
Views: 7145
Reputation: 428
You can set an HTML Footer and give the proper format:
$mpdf->SetHTMLFooter('<div style="text-align: center">{PAGENO} of {nbpg}</div>');
Upvotes: 6
Reputation: 9396
you can try the following:
$mpdf->setFooter('|{PAGENO} of {nbpg}|');
This will center align the page numbers. Any thing on the left of first |
will be left aligned and anything on the right of second |
will be right alligned.
Upvotes: 6