如何获取MPDF中的总页数? [英] How to get the total number of pages in MPDF?

查看:71
本文介绍了如何获取MPDF中的总页数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PHP MPDF创建PDF文件.在页脚处,我可以使用

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

{PAGENO}

但是如何获取PDF文件中的总页数?这样在页脚中,我可以像这样打印:

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

推荐答案

根据官方文档 :

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

这篇关于如何获取MPDF中的总页数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆