我需要以pdf格式获取pdf的总页数。我可以通过写下来获取页脚的总页数或当前页码:
{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');