The second half of your challenge, AFAICS, is in principle the same as writing an on-the-fly PDF doc from any data source. If that's right, then it's a subject I've grappled with a little bit, and where I've found the existing PDF modules didn't do quite what I wanted for the most part - surprising, given what one comes to expect to find at CPAN, and a challenge for a module writer perhaps.
in reply to Merging an FDF into a PDF
I settled on PDF::Create, which has relatively limited functionality, but is easy to learn and very much does what it says on the can. I also wrote some routines which are half way between script and module, that I used to extend its capabilities. They, and some other things you might find useful, are in this thread.
If you do find something that works, it would be interesting to know about it - good luck!
§ George Sherston