Linux: Get number of pages of PDF document via command line

$> pdfinfo document.pdf | grep "Pages\:" | grep -o "[0-9]"
In order to get web preview of pdf files from my web server I needed to get number of pages of the file.

This single command gives this information directly.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.