Words count for PDF file in 3 steps

This article will show you how to count words in a .PDF file using Javascript console in Adobe Acrobat. If you are not familiar with Javascript console in Acrobat, you can read more in here but in general, you do not need to know too much about it. The following instruction is very easy to follow.

Step 1: Start Javascript console by pressing Ctrl + J (on Windows) or Command + J (on Mac OS)
Then you will have Javascript Debugger windows opened.

Step 2: In the text box below View:Console
You type in (or copy, paste) the following codes

var cnt=0;
for (var p = 0; p < this.numPages; p++) cnt += getPageNumWords(p);
app.alert("There are " + cnt + " words in this file.");

Step 3: Select all the code (the above 3 lines), press Control + Enter (or Command + Enter on Mac OS). If you have a numpad, press Enter there

Then you will have a alert windows tells you how many words in your documents.

Have fun.
Lam Hoang

No comments:

Post a Comment