top of page

Javascript to get PDF page counts


George Johnson has posted javascript on the Adobe forum here, which you can use in Adobe Acrobat to get the page counts of multiple PDFs. Follow these steps, in Adobe Acrobat XI:

1. In the Tools console, go to Action Wizard and select 'Create New Action'.

2. Choose More Tools . . . Execute Javascript and click it into the 'Action steps to follow' area on the right. Uncheck the 'Prompt User' box, and click in 'Specify Settings'.

3. Enter this script in the Javascript Editor:

console.println(documentFileName + "\t" + numPages);

4. Name and save the action.

5. When you click on the new action in the Action Wizard menu, you will be prompted to select multiple PDF files.

6. Click start and Acrobat will start to open the files and generate a list of their page counts.

7. Close the action and go back to the Tools console. Select the JavaScript menu., and click on Javascript Debugger.

8. Select 'Console' in the View menu. A list of the PDF file names and their page counts will be displayed. You can easily copy this and parse it out in Excel.


bottom of page