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

前端 未结 7 707
深忆病人
深忆病人 2021-02-01 01:37

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 getti

相关标签:
7条回答
  • 2021-02-01 02:06

    Because you asked for a "batch file" I have to assume you only want a Windows-based solution. But, just in case Mac OS X is an option, here something that could be useful. If you have the PDFs on a Mac, on a drive that has been indexed by Spotlight (the default), the following command will return the number of pages using no external dependencies:

    mdls -name kMDItemNumberOfPages POSIX_PATH_OF_PDF_FILE
    

    Source: MacScripter.net - http://macscripter.net/viewtopic.php?id=32381

    0 讨论(0)
提交回复
热议问题