Saturday, March 14, 2009

PDFEdit

The IRS has PDF tax return forms. Normally, if you want to enter your own values into the form you download Adobe's Acrobat. Normally, I think Adobe makes shoddy products that I don't want to use. So I thought I'd use a free alternative.

First, I used fink to install kpdf. Which worked fine, if you want to read PDFs and you don't want to edit them.

So I searched around and discovered PDFEdit, which is supposed to edit PDFs.

It isn't available in my package manager, fink, so I downloaded the source and tried to compile it. I'll share some notes here because I found some oddities.

I used fink to get all required libraries. This puts them in /sw/lib. No big deal.

Configure required the following command:
>sudo ./configure --prefix=/usr/local --with-boost=/sw --with-boost-libdir=/sw QTDIR=/sw/lib/qt3

Notice that the QTDIR is set on the command line. Which is weird, because it is in all of my environments already. But without this addition, the command won't work.

now, if you try "sudo make", the script will barf on what appears to be a ranlib command. So I tried the command interactively to see about the error, and it worked fine. Turns out the problem is QTDIR again, so the following command worked:
>sudo make QTDIR=/sw/lib/gt3

And once again, "sudo make install" won't work without QTDIR, so once again:
>sudo make install QTDIR=/sw/lib/gt3

Now the program runs, and to the extent it is capable, it works. But "works" is different than "works as expected". Sure, PDFEdit will let you edit PDFs, but you need a degree of patience that I don't possess. This tool is, in my exaggerated opinion, a single step up from using a hex editor to modify PDFs.

Look at this screenshot (click to enlarge):


You simply selected a field, the social security number, and then use the panel on the right to pick out the PDF element from a tree, and then use the panel on the bottom right to insert a new value. I'm not sure whether to select l, m, s, l, or m from the object list. I'm not confident that changing any of these values will avoid PDF corruption. The process is scary.

If I'm scared by this software, I can't imagine what other users feel.

I'll stick to a pencil.