All the code I've seen for this sort of things is Adobe Acrobat.

I did find a useful link earlier, I'll post it later.