如何获得TCPDF中的总页数? [英] How to get total no of pages in TCPDF?

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

问题描述

我使用 getNumPages()函数获取tcpdf中的总页数,但是没有得到正确的输出。我应该怎么做才能得到正确的数字?

I used getNumPages() function to get the total number of pages in tcpdf, but I didn't get the correct output. What should I do to get the correct number?

推荐答案

getNumPages()就像你在页脚,它给我的麻烦,因为它显示了到目前为止已经插入的页面数量 。所以我得到1/1,2/2,3/3等。

Hi I just wanted to add for anyone reading this, that I was using getNumPages() like you in the footer and it was giving me trouble because it was showing me the number of pages inserted up to now. So I was getting 1/1, 2/2, 3/3, etc.

这是我第一次尝试:

$this->getPage().'/'.$this->getNumPages()

我查看了示例编号3 ,并使用

$this->getAliasNumPage().'/'.$this->getAliasNbPages()

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

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