probably look at HTML::Template for your HTML Templates, and
PDF::Template for your PDF Templates.
I can't help but mention XML combined with XSL to produce HTML
wherever necessary and follow the path along FO to PS/PDF wherever
that is needed. Have often used that to create presentations and
printed handouts using the DocBook "Slides" DTD for example.
I have hesitated to do this simply because I have always felt that
anything to do with processing XML will need the XML parser and its DTD
checking, grammar checking, etc, which will add a lot of CPU load. Our
template patching for Web applications often needs to patch five to ten
templates to arrive at just one screen, i.e. in response to one "submit"
button click. Therefore, this is executed so frequently, for such small
templates, that any CPU overhead here would kill the system throughput.
However, for generating large documents (e.g. hand-written reports, or
MIS reports presented online but infrequently), I guess XML would be
great. We maintain a Linux HOWTO; we use the DocBook structure for that.
Again, a rather ill-researched suggestion, but I think
this is worth
thinking about if you want to have information independent of multiple
styles of representation.
I think most people will agree on XML for such situations.