in reply to how do i create PDF dynamically
Try PDF::Reuse. It allows you to create a PDF template and add text on top in the positions you want.
A lot simplier and very fast.
See the tutorial for examples.