Don't even try to understand this.

No, don't. It's scary. This is form generation worth complaining about.
It's pretty insane, and there has to be a better way to do it.

Also, don't store data like this.
Added format support for PDF.
Merge pull request #1 from tjlytle/master

Working (?) PoC