Skip to main content
Participating Frequently
May 25, 2022
Question

Count Pages in Directorys and Files

  • May 25, 2022
  • 2 replies
  • 6241 views

Hello,

with an older version of Adobe Acrobat we could count pages of files in a bunch of directorys. We need this to know what our costumers have to pay for our work.

Is there a script for Acrobat DC to make the same work than before?

 

Thank you

Ivo

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
May 25, 2022

You can do it using a simple script in an Action. Do you want to total all the pages of all the files in the folder, or to print out the number of pages in each file?

Ivo16E5Author
Participating Frequently
May 25, 2022

I need the total of all pages in one directory or "many" directorys within one specific place.

Filedirectorys (specific place)
- filedirectory1

- filedirectory2

....

 That would be great to have (maybe to know how its done)

Thx so far

try67
Community Expert
Community Expert
May 25, 2022

Go to Tools - Action Wizard and create an Action with a command to execute the following JS code:

 

if (global.pagesCounter==null) global.pagesCounter=0;

global.pagesCounter+=this.numPages;

 

Save it as "Count Pages".

Now create a Custom Command with this code:

 

if (global.pagesCounter==null) app.alert("You must first run the \"Count Pages\" Action.");

else {app.alert("Number of pages counted: " + global.pagesCounter,3); delete global.pagesCounter;}

 

Run the Action on your files/folder (if you select a folder it will automatically process all the sub-folders underneath it, too, but will also convert all non-PDFs to PDF files, so be careful!), and then click the Custom Command to display the results.

Bernd Alheit
Community Expert
Community Expert
May 25, 2022

What have you used in the old version of Adobe Acrobat Pro?

Ivo16E5Author
Participating Frequently
May 25, 2022

it was named "count pages" - a java script. It was in tools when it was opened once in acrobat (X, Pro whatever). You could choose directorys from the server or where ever. It counted through and showed number of files and number of pages.

Bernd Alheit
Community Expert
Community Expert
May 25, 2022

You can use this sequence in Adobe Acrobat DC Pro.