Here's a question that should have a familiar ring for CAR veterans: How do I get text out of a PDF file?

If your experience has been anything like mine, the answer is likely to be "painfully, if at all."

The existence of Adobe Portable Document Files has been a boon for reporters because governments and agencies everywhere have been able to make documents broadly available over the Internet. It's hard not to love the idea of a file that looks the same no matter what kind of computer you have.

But if you've ever tried getting tables out of a PDF document - and we all have - the results usually aren't worth the effort. Until now. (See "Slicing and dicing those pesky PDFs" in the July-August 2003 Uplink.)

If you're ready to leave behind the annoyance of copying and pasting from PDF files, a free command line utility called Xpdf will save you time and aggravation. It will, in most circumstances, enable you to go from PDF to Microsoft Excel in a matter of seconds, rather than minutes or hours. Did I mention that it's free?

Although Xpdf comes with many versions of the Unix or Linux operating systems, Microsoft Windows users will need to download and install the small application in order to run it.

Xpdf can be downloaded from www.foolabs.com/xpdf/download.html, and it comes in packages for Windows and Linux/Unix. Look for the precompiled binaries for your operating system. A DOS version is available, but unless you run DOS as your primary operating system, the Windows version should be your choice. The Windows version does not have all the features of the Linux/Unix version, but it has all you'll need for converting PDFs to text tables.

First, save the download file (a zip file) to your computer and then unzip it into a directory (c:\xpdf works fine). Then, and this is the technical bit, when you have a PDF you want to get tabular text from, simply place the PDF in that directory, open a command prompt, then navigate to c:\xpdf and type:

pdftotext layout pdfname.pdf

Depending on the size of the PDF file, your output text file (with the same name as the original) will be in the same directory in a matter of seconds.

Let's go through the command line syntax. First, the command "pdftotext" is required for this process, and "pdf2text" won't work. The "-layout" tag tells Xpdf that you want to preserve the layout that the PDF file uses, which keeps the text in those nice, clean tables. And you need to have the full name of the file (I recommend a single-word name, even though Windows supports filenames with spaces). That's it. You would be forgiven for thinking that it can't be that easy, but it really is.

The resulting text file will be the entire text of the PDF, meaning that you may have to wade through pages of text in order to get to your tables. The preservation of the PDF's layout means that if a page contained two tables side-by-side, that's the way they will look in the text file, too.

Xpdf doesn't work in all instances; specifically, it won't convert PDFs that have been locked by their creators. Don't bother asking the author of Xpdf, either, as he has posted a message on his Web site indicating that he will not add that ability.

For dealing with most government documents, Xpdf can be a huge time-saver and allow you to spend more time actually analyzing data rather than trying to free it from the confines of the PDF.