i was wondering if there is a way to check for the number of pages of a pdf file without extracting the pages and counting the number of jpg files it generated.
thanks in advance
regards,
sonus
page count of a pdf file
-
- Posts: 1
- Joined: 2019-01-15T09:29:39-07:00
- Authentication code: 1152
Re: page count of a pdf file
I just tried this and was happy to see the number of pages, however, it was a repeating string of the number of pages.
Any idea how I get this to return just '16'?
Thank you,
David
Code: Select all
$ identify -format %n test.pdf
16161616161616161616161616161616
Thank you,
David
Re: page count of a pdf file
pdfinfo sample.pdf | grep -a Pages | cut -d : -f 2
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: page count of a pdf file
Or:
Code: Select all
identify -format %n\n in.pdf |head -n1
snibgo's IM pages: im.snibgo.com
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: page count of a pdf file
Try something like this...
Code: Select all
convert document.pdf -set option:totpages %[n] -delete 1--1 -format "%[totpages]\n" info: