问题
I am generating the pdf report using the mpdf and library , i wanted to get the current page number so that i can get the current page number while iam generating the pdf.
Thanks
回答1:
add this to a main mPDF class:
function getPageCount() {
return count($this->pages);
}
and use something like this:
$PageCount = $this->getPageCount();
来源:https://stackoverflow.com/questions/22043126/how-to-get-the-current-page-number-in-mpdf