pdf page count

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
geroldboehler

pdf page count

Post by geroldboehler »

hi - is it possible to find out how many pages a pdf document has? - thanks - gerold
geroldboehler

Re: pdf page count

Post by geroldboehler »

bump
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: pdf page count

Post by magick »

To return the number of pages in a PDF document, use this command:
  • identify -format %n image.pdf
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: pdf page count

Post by anthony »

However this is probably very inefficent way. You are probably better of using a PDF tool that can extract the page count directly from the PDF file.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
geroldboehler

Re: pdf page count

Post by geroldboehler »

thanks for your help, i will give it a try.
Post Reply