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

前端 未结 7 704
深忆病人
深忆病人 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 01:53

    Alternatively you can use the command, which returns only the number:

    pdfinfo "${PDFFILE}" | grep Pages | sed 's/[^0-9]*//'

    You will need the xpdf package (usually preinstalled in many distributions):

    http://www.foolabs.com/xpdf/download.html

提交回复
热议问题