How to get total no of pages in TCPDF?

孤者浪人 提交于 2019-12-20 02:19:06

问题


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?


回答1:


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 is what I tried at first:

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

I looked at example number 3 and used the following instead to get the correct result.

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


来源:https://stackoverflow.com/questions/9977594/how-to-get-total-no-of-pages-in-tcpdf

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