pdfbatch-filecmd

Get number of pages in a pdf using a cmd batch file


I can see there are a lot of questions for getting the number of pages in a a pdf with C, PHP and others but am wondering with a batch file or cmd is there a simple way of getting the number of pages?


Solution

  • Using pdftk:

    pdftk my.pdf dump_data | grep NumberOfPages

    does the trick.