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);
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.