I've used a couple of techniques to generate PDFs on the fly. The first one used a Java agent with the iText library. Everything was hand-cranked - the whole content of the PDF was generated by the Java agent and whilst it worked pretty well it was a long-winded job.
The second method used a Word template with bookmarks as described in this post by Jakob Majkilde (http://blog.majkilde.com/2008/12/word-integration.html). The Word document was then saved as a PDF also described by Jakob (http://blog.majkilde.com/2009/09/creating-pdf-files-with-office-2007.html). Again this worked pretty well, although I seem to remember that images on the Word template appeared to degrade when the document was saved to PDF.
I need to do this again in the near future, so I think I'll take a look at the technique you've described here. Thanks, Jake.