How to get the total number of pages in MPDF?

安稳与你 提交于 2019-12-06 20:50:59

问题


I'm using PHP MPDF to create PDF files. At the footer I'm able to print the current page number using

{PAGENO}

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

Page (Current Page) of (Total number of pages)   
Page 1 of 6

回答1:


According to the official documentation:

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



回答2:


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



来源:https://stackoverflow.com/questions/17083746/how-to-get-the-total-number-of-pages-in-mpdf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!