简体   繁体   English

PHP Zend Framework Zend_Pdf-pdf文档的页数

[英]PHP Zend Framework Zend_Pdf - number of pages of pdf document

simple thing which I need to do is, that I have a pdf document and i need return number of pages of this document. 我需要做的简单的事情是,我有一个pdf文档,我需要返回此文档的页数。 I should to do this with a Zend Framework. 我应该使用Zend框架来做到这一点。

Thanks in advance for answers 预先感谢您的回答

You can get the number of pages by counting the elements of the $pages property: 您可以通过计算$pages属性的元素来获取$pages

$pdf = new Zend_Pdf; // load your PDF file here
$pageCount = count($pdf->pages);

您可以使用count($pdf->pages)来获取pdf页数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM