How to get the total number of pages in MPDF?

I am using PHP MPDF to create PDF files. In the footer, I can print the current page number using

{PAGENO} 

But how do I get the total number of pages in a PDF file? So in the footer I can print as:

 Page (Current Page) of (Total number of pages) Page 1 of 6 
+6
source share
2 answers

According to official documentation:

 $mpdf=new mPDF(); $mpdf->setFooter("Page {PAGENO} of {nb}"); 
+15
source

you can use {nb} , it gives the total number of pages in mpdf

+6
source

Source: https://habr.com/ru/post/947200/


All Articles