Get number of pages in a pdf using a cmd batch file March 19, 2023 by Tarik Using pdftk: pdftk my.pdf dump_data | grep NumberOfPages does the trick.