The more I look at the and think about it, the more it seems the template portion should be completly seperate from the PDF generation portion. Is there any real reason to combine those two together? Then HTML, PDF, EXCEL would all use the same template code and the post parse the output in the needed form. Code might look like:
use Simple::Template; #dunno what you would call it but it pulls the *template* portions out
my $pdf = Simple::Template->new(filename => $filename, processor => PDF::Template->new() );
$pdf->output_file($filename . '.pdf');
PDF::Template could even automate the calls to Simple::Template. A generic backend template would have the advantage that the user could use HTML::Template (style) or TT or something else to generate the final code to send to the Processor.