2

I have over 200 PDF files of various sizes. I estimate that it's about 200-250k pages. Is there a relatively simple way to determine the total page count for all of these files - combined- in MacOS?

Highlighting all -> Info generates a single window that does not provide the information.

My first thought was Preview - however it seems to be unable to open even a dozen or so together without running into problems (doesn't open each file (will open 9 of 10 for some reason?), crashes, etc.).

Saw How to count pages in multiple PDF files? however this is on Mac, and I'd really rather not duplicate and then merge all of the files..

Would appreciate your thoughts!

MacOS 10.12.6

Have Adobe Acrobat DC (so this is an option)

3

There is a terminal command 'pdfinfo aa.pdf' which will print info, including the number of pages, of the file aa.pdf. You should be able to run this in batch mode with the output piped to a file. You can then use grep, awk, or sed to extract the word 'pages' from the file and get a table of the number of pages in each file.

You can also drag a file or many files onto the terminal to run this in batch mode.

  • 1
    This is an awesome suggestion - also worth mentioning to any future readers that you can drag and drop files directly to the terminal, even in batches. – Gryph Aug 26 '17 at 3:40
-1

You can use cpdf (Mac OS X/Microsoft Windows/Linux) and iterate over all files in a directory using a 'for' loop.

To print the number of pages in one PDF:

cpdf -pages "my file.pdf"

From the terminal in Mac OS X or Linux, to print the number of pages in all the PDF files the current folder contains:

for f in *.pdf; do cpdf.exe -pages $f; done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.