Just found another useful tool for manipulating PDF's: the PDF Toolkit. It's a command line tool based on iText that I use mostly for merging PDF's together. The big downside is that embedded Javascript is lost, so that has to be added to the PDF after it has been put together.
So my free (as in free beer and free speech) PDF tools now include:
- Open Office, for creating PDF's from word processing documents.
- PDF Escape, for modifying and adding fields (text, checkboxes). This does preserve Javascript code, but compresses everything so you can't edit it further.
- pdftk, for merging PDF's.
- tcpdf, for creating PDF's with PHP.
- A good text editor and a thorough understanding of the PDF specification, to hand tweak.
The PDF specification is very particular about byte lengths of each element, with a table at the end that specifies exactly where in the file everything is, but the most recent Adobe Reader is pretty forgiving (a millisecond alert pops up that it is trying to fix the file). That's important if I'm hand-tweaking a PDF, since I can't correct the cross reference table. PDF Escape, fortunately, will correct everything, so if it's important I can just upload the tweaked PDF and download it back.
Hacking at 0300 : Adding Javascript to PDF Files says:
[…] of the patient's name, birthdate, address etc. There had to be a better way, and one that uses only free tools (I'm not buying Acrobat for […]
June 6, 2012, 2:33 pm