Is there any command-line utility to find the number of words in a PDF?
I will use the number of words in a pdf to estimate the time I'll spent reading it. I can get the number of pages of a PDF with
qpdf, but the number of pages is a bad estimate to the time required to read a book, since a page can contain few or lots of text.
A worst case scenario to achieve my goal would be converting PDFs to plain text using
pdftotext), then using
wc to count the number of words and characters. But that is bad: it will take time to convert the pdf to text, them create useless large text files just to calculate the number of words. Since PDFs can contain hundreds of pages, this solution is not efficient.