Monday, January 10, 2011

I don't do a lot of reposts, but it had been a while since I used the tool I am mentioning. If nothing else, this is like a bookmark and memory jogger for me...

I had a few PDFs on-hand that I wanted to back up but save on my local machine as text files. There are a number of ways to do this, but the easiest (and cheapest) way was to get Xpdf from here. One utility program included with Xpdf is pdftotext. I then had to figure out a way to use pdftotext to convert my files in one big batch. Here's what I did. First, I dragged the few hundred desired files to the directory where pdftotext.exe was located. Next, I used the command prompt (under Vista, Start->Run->cmd) dir to make a list of all the PDF files in the same directory (dir *.pdf /b > list). As for batching the file conversion, I then used the FOR command included with the cmd program. Here's the applicable syntax:

for /F %i in (list) DO pdftotext %i

Worked like a champ!

No comments: