topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday April 23, 2024, 6:17 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - senturion [ switch to compact view ]

Pages: [1]
1
Coding Snack Guidelines / Re: Count Number of Pages in PDF Files
« on: July 21, 2014, 01:50 PM »
Perhaps a couple things to note when you are running the above script in a top-level directory containing 58,000+ PDF documents:

A. This will take a while :)

B. Prepare for cmd.exe to start consuming memory. We're up to 2.97 GB used by CMD.exe at the moment. I may have to let this run overnight instead.  :P

2
Coding Snack Guidelines / Re: Count Number of Pages in PDF Files
« on: July 21, 2014, 12:38 PM »
Thank you 4wd!!!


This greatly helped me. I'm now saving the script and binaries and dependencies into a zip for future use. I had also added a bit onto the batch to give me the file size in addition. Then when I open in Excel I'd convert it to kilobytes (as it is in bytes to begin with). Here is the script including file size:

REM PDF-Pages.cmd
@echo off
del output.txt
for /r %1 %%f in (*.pdf) do pdfinfo.exe -meta "%%f" >out.txt & echo "%%f", | tr.exe -d "\r\n" >>output.txt & find "Pages:" out.txt | tr.exe -d "\r\n\055\056\072[:alpha:][:space:]" >>output.txt & echo , | tr.exe -d "\r\n" >>output.txt & find "File size:" out.txt | tr.exe -d "\055\056\072[:space:][:alpha:]" >>output.txt & echo. >>output.txt
del out.txt


Pages: [1]