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

Count no of pages in a PDF file/files in a folder

antonyprince82
Registered: Nov 29 2010
Posts: 2

I am using the below javascript to count the no of pages in a PDF document/documents in a particular location(folder). I get the output in the console window but i would like to get the output in an excel sheet. Since I handle many number of PDF files, i would like to get the o/p in an excel sheet so that i can use it for reports.
 
if ( typeof global.PageCnt == "undefined")
{
console.show();
console.clear();
global.PageCnt = 0;
}
global.PageCnt += this.numPages;
console.println("The file " + this.path + " has "
+ this.numPages);
console.println("Total so far = " + global.PageCnt);

My Product Information:
Acrobat Standard 8.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
This is probably better done with an external script or program, perhaps using IAC (InterApplication Communications). It is easier than batch processing to create the data file and optionally launch it. More info is available in the Acrobat SDK.

There are also a number of commercial and freely available utilities that do what you want that you should be able to find with a search.

If you're interested in a VBScript that does what you want (for a reasonable price), feel free to contact me by email. The advantage is it's customizable to suit your exact needs. You can, for example, include information on page sizes, form fields, metadata, etc.