in reply to how do i create PDF dynamically

If you'll be working with html content, HTML::HTMLDoc might work for you.