Thursday, June 18, 2009

Count words in a PDF file on Mac OS X

To count the amount of words in a PDF file on Mac OS X, just open the Terminal.app and type: ps2ascii myfile.pdf | wc -w, where myfile.pdf is the name of the PDF, of which you want to count the words. Of course you can also use all the other options of the wc command (such as counting characters, etc.).

Via macosxhints (second comment by kalderon).

2 comments:

sejko said...

Thank you! This is the most direct way :)

Fabian Corrales said...

Note that this method also counts other elements. In a test I ran, it counted the page number at the bottom of the page.