I've written a module for templating ODT files (OpenOffice documents) in order to do exactly the thing that you ask: I write a template using OpenOffice, a perl program expands the template using data from a given structure, then OpenOffice converts the resulting ODT in a PDF file.
The module is in pre-alpha stage: it works (mostly) but has no test suite and poor documentation, but if you are interested in it I can make it downloadable somewhere.
Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."