Sunday, April 14, 2013

Get page numbers of PDF files

This small script would list all PDF files in a folder along with the number of pages in each one of them. is nothing by the pdfid python script.

for f in *.pdf
    #echo $f
    pagenumber=`/usr/bin/ "$f" | grep "Page" | cut -de -f2`
    echo "$f    $pagenumber"

1.pdf                 5
2.pdf                 6
3.pdf                 7
4.pdf                 8

No comments:

Post a Comment