/ Published in: PHP
Expand |
Embed | Plain Text
METHOD 1 ImageMagick: identify -density 12 -format "%p" image.pdf METHOD 2 http://www.setasign.de/products/pdf-php-solutions/fpdi/demos/thumbnails/ METHOD 3 function count_pages($pdfname) { return $num; }
Comments
Subscribe to comments
You need to login to post a comment.

If you're using Linux, you can also try pdfinfo:
pdfinfo myfile.pdf | awk '/Pages/ {print $2}'Using pdfinfo gives you access to a lot of information on the document.
Thank you, fugue, that ended up being what I went with. Much appreciated!
Does anyone know how to duplicate "http://ian.umces.edu/pdfs/ianpresentation20091124145318.pdf" using PHP's imagick?
Nevermind - it is: getNumberImages()
Oh, and in case someone using imagemagick at the command is confused by the output of identify -density 12 -format "%p" image.pdf, try identify -format "%n" image.pdf
Finally, sorry for the weird post with that url - I meant to write "identify -density 12 -format "%p" image.pdf" - I guess I pasted the wrong contents from my clipboard