Php mpdf获取pdf正文中的总页码(不在页眉/页脚中)
我需要在pdf正文中获得pdf中的总页数。我可以通过以下方式获取页脚中的总页码或当前页码:Php mpdf获取pdf正文中的总页码(不在页眉/页脚中),php,pdf,mpdf,Php,Pdf,Mpdf,我需要在pdf正文中获得pdf中的总页数。我可以通过以下方式获取页脚中的总页码或当前页码: {PAGENO}/{nb} 但我需要正文中的总页数: $mpdf = new \Mpdf\Mpdf(); $mpdf->SetHtmlHeader($header, 'OE'); $mpdf->SetHTMLFooter($footer, 'OE'); $mpdf->AddPage('', // L - landscape, P - portrait '',
{PAGENO}/{nb}
但我需要正文中的总页数:
$mpdf = new \Mpdf\Mpdf();
$mpdf->SetHtmlHeader($header, 'OE');
$mpdf->SetHTMLFooter($footer, 'OE');
$mpdf->AddPage('', // L - landscape, P - portrait
'', '', '', '', 20, // margin_left
20, // margin right
5, // margin top
25, // margin bottom
10, // margin header
10); // margin footer
$mpdf->WriteHTML($html); //here comes the html of pdf body and i need total pages count in it.
$mpdf->Output($title . '.pdf', 'd');