These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

this.getPageNumWords don't returns the same result

Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766

Hi,

using the same JavaScript [this.getPageNumWord()] in the same PDF-document don't returns the same result :

- Acrobat 5 : 34277 words in the doc

- Acrobat 6 Pro : 34255 words in the doc

- Acrobat 8 Pro and Acrobat 9 Pro : 35100 words in the doc

Is this JavaScript function reliable ???
What happens ?
Where is the good result ?

I'll try with Acrobat 7 this afternoon...

My Product Information:
Acrobat Pro 9.1, Macintosh
Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
Acrobat 7 Pro : 34255

Same result as Acrobat 6.

???
try67
Expert
Registered: Oct 30 2008
Posts: 2398
You can run a comparison and see where the difference occurs. My guess would be with hyphenated words, numbers, or something of the sort.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
I can' t make a comparison : the PDF is exactly the same, and the JavaScript too.

You can download it, it's part of my abracadabraTOOLS (Word counter).
try67
Expert
Registered: Oct 30 2008
Posts: 2398
You can make a comparison of the words Acrobat identifies per page.
Have each application export the list of words to a CSV file and open those in Excel. You can easily see (or calculate using the "same" function) where the differences lie.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
Thanks for your help but it isn't really helpful : I need a reliable function, but I can't consume my time to know why it's not reliable…

:-(
try67
Expert
Registered: Oct 30 2008
Posts: 2398
The function is reliable. There's obviously some kind of difference in the way the file is created in the different applications. But if you can't be bothered to check what's going on, that's your decision.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
Sorry if I'd hurted you, english is not my native language.

I mean that the only difference in my tests is the Acrobat version number, the PDF file is always exactly the same, and the (app-level) JavaScript too.

So, I'd obviously guessed that the error/difference in the word-count results cames from Acrobat itself, not from the PDF nor the JavaScript…
I may be wrong… but in any case I can't figure how to proceed the comparison you're talking about… I'm not a JavaScript Jedi, so hard task for me…

;-)