by jsrn · 15y ago · 0 comments
You could use pdfinfo - in Debian / Ubuntu, it is in the same package as pdftotext (poppler-utils).
To extract (only) the number of pages of a PDF:
$ pdfinfo FILE.pdf | grep '^Pages' | tr -s ' ' | cut -d ' ' -f 2