2016/6/4

How to count words in a PDF file with JavaScript?

Paste the follow code in JavaScript Console of Adobe Acrobat, highlight the code and then press Ctrl + Enter.

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

沒有留言: