• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Word Count

New Here ,
Dec 05, 2012 Dec 05, 2012

Copy link to clipboard

Copied

How do I count words in an English PDF document?

Views

224.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 28, 2023 Apr 28, 2023

Copy link to clipboard

Copied

HOW does one run a WORD COUNT in Acrobat? 

Like you, I'm dealing with novel manuscripts -- 50,000 to more than 100,000 words.

Thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 28, 2023 Apr 28, 2023

Copy link to clipboard

Copied

Read the thread. Multiple answers were provided to this question.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 05, 2012 Dec 05, 2012

Copy link to clipboard

Copied

Or, you could copy/paste into a Word document and do the word count there.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 20, 2013 Oct 20, 2013

Copy link to clipboard

Copied

You can also create an Action Wizard with Dave's script and by changing "console.printIn" to "app.alert" a dialog box will pop up with the page count.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 20, 2013 Oct 20, 2013

Copy link to clipboard

Copied

Actions are not available in Reader, only in Acrobat Pro.

And using an alert in an Action is counter-productive as it means you have to sit in front of it, clicking OK, OK, OK...

It's better to print out the result to the console, preceded by the name of the file that's being processed.

Then when the process is done you open the console and see all the results in one glance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 16, 2016 Feb 16, 2016

Copy link to clipboard

Copied

On Windows platform you can use AnyCount Word Count and Character Count Software

It supports word count in 38 formats including PDF. Actually, it can count even on PC without Adobe Acrobat installed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 10, 2016 Nov 10, 2016

Copy link to clipboard

Copied

I have used the below JavaScript, and it works well. But does anyone know, if it is possible to make a JavaScript that instead of counting words, counts characters including spaces?

var cnt=0;

for (var p = 0; p < this.numPages; p++) cnt += getPageNumWords(p);

console.println("There are " + cnt + " words in this file.");

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 10, 2016 Nov 10, 2016

Copy link to clipboard

Copied

You could write a script that looped through the words, got the number of characters in each one, and added together. You can't get spaces or punctuation, the spaces often aren't even there (just gaps). You could add 1 for each word, which would be approximate but not (for example) a solid basis for payment.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 10, 2016 Nov 10, 2016

Copy link to clipboard

Copied

Actually, you can get spaces and punctuation by setting the third parameter (bStrip) of getPageNthWord as false.

This code will count all the characters in a document:

var charCount = 0;

for (var p=0; p<this.numPages; p++) {

    var numWords = this.getPageNumWords(p);

    for (var i=0; i<numWords; i++) {

        var word = this.getPageNthWord(p,i,false);

        charCount+=word.length;

    }

}

app.alert("There are " + charCount + " characters in this file.",3);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 10, 2016 Nov 10, 2016

Copy link to clipboard

Copied

Thanks try67. I just got one question. When I test your code, in a single PDF page, it says there is 1608 characters, but if i export the same PDF page into word, word says there are 1568 characters. Any idea why those two are different?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2016 Nov 11, 2016

Copy link to clipboard

Copied

Not really, sorry. There could be all kinds of issues related to how some characters like spaces, line-breaks, tabs, etc. are counted. Don't expect to get exactly the same results in both applications.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 20, 2017 Feb 20, 2017

Copy link to clipboard

Copied

Love this - but anyone know how to tweak the JS to count a specific page/page range? Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 21, 2017 Feb 21, 2017

Copy link to clipboard

Copied

Let's say you want to count from page 3 to page 10.

Change this part of the code:

for (var p = 0; p < this.numPages; p++)

To this:

for (var p = 2; p<=9; p++)

(notice the page numbers are 0-based...)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 21, 2017 Feb 21, 2017

Copy link to clipboard

Copied

Awesome! Thanks so much for the super speedy reply  

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 22, 2017 May 22, 2017

Copy link to clipboard

Copied

Hi Dynamedix,

There are many software or online word counter tools are available on the Google to count the words. It's the really the very tough task if you count one by one. To count the word with in the PDF file

  • Just select all the content.
  • Copy and paste it into the word document.
  • Go to formatting section and hit the word count option and the total number of the words will be displayed.

Otherwise try other online word count tool by uploading file or extracting the text.

online-word-count-tool.png.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 25, 2020 Jan 25, 2020

Copy link to clipboard

Copied

Hi,

 

++Adding to this old thread, here's an workaround observation that turned out to work for me in both Acrobat Reader DC and partially in Adobe Reader mobile app, and a third party mobile PDF viewer.

 

Adobe Acrobat Reader mobile app doesn't have word count and neither does Acrobat Reader DC.

 

However, the following method proved to be useful:

 

  • with Acrobat Pro DC you can create a single blank PDF page, and place a button with a javascript action to perform a word count. 

 

  • Download the PDF with the button script to your mobile device via USB cable, or get the PDF with the action button from here: Word Count Action Script Button  

 

  • And all you have to do is open Acrobat Reader Mobile and merge or combine this PDF with whatever document you want to perform the word count with. You can do the same with Adobe Reader DC 

 

 

See slides below.

 

With your main document opened select combine files and add the PDF with the button script that I've shared above

 

 

Screenshot_20200125-074528.jpg

 

Select Combine to merge both PDFs.

 

Screenshot_20200125-074621.jpg

 

 

 

  • When you open your combined PDF file click on the action script button to get the wordcount of your merged PDF document. 

 

Below, selecting Organize Pages tool to see the final result of the merged documents :

 

  • Screenshot_20200125-074656.jpg

 

NOTE: Be advised that the wordcount script might not be entirely accurate since the total word count seems to vary from app to app.

 

For example, in Adobe Reader DC the script will count all of the form field objects (like  text form fields, drop down menus, and even the event button objects with a label) even if they're blank, and then include in the word count total all of these form field object plus the real count of the text words that were found throughout the PDF.

 

Curiously enough, in a third-party appp like Foxit,  it is able to count the exact words that are in the PDF.

 

For some reason I haven't been able to have the script  to work in Adobe Reader mobile app, but the Adobe Reader app does allow me to merge two or more documents with the PDF that has the script.

 

On the other hand, the third party mobile app doesn't provides me with a merging capability (that I know of) but the script executed and worked fine in this third party app after it was merged with the Adobe Adobe Reader mobile app.

 

Here is the script originally posted by Dave Merchant: 

 

 

 

 

 

 

var cnt=0;

for (var p = 0; p < this.numPages; p++) cnt += getPageNumWords(p);

app.alert("There are " + cnt + " words in this file.");

 

 

 

See slide below using third party app:

 

 

 

 

20200125_131759.jpg

 

 

 

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 26, 2020 Jan 26, 2020

Copy link to clipboard

Copied

This won't work in Reader DC, since it can't merge PDF files.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 26, 2020 Jan 26, 2020

Copy link to clipboard

Copied

Correct, but with the Reader mobile app (at least with AndroidOS) allows to merge using the Organize Pages tool.

 

The user will need a paid subscription with Acrobat Pro DC of course.

 

Then upload the PDF back to the cloud back to a PC with Reader.

 

I know... is completely unorthodox, but just food for thought for those great developers out there such as yourself.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 26, 2020 Jan 26, 2020

Copy link to clipboard

Copied

If you want to do it in Reader you can use this free tool I've developed. Once installed it takes a single click to run it: http://try67.blogspot.com/2015/01/reader-word-count-free.html

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 26, 2020 Jan 26, 2020

Copy link to clipboard

Copied

Hey, thank you so much as usual for sharing this!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 01, 2023 Sep 01, 2023

Copy link to clipboard

Copied

LATEST

sumon gazi

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines