Introduction to PDF::API2 and HTML::Template
Glenn Pringle provided an introduction to building PDF files in Perl.
He focused on the
PDF::API2 module. Although this module
is pretty low-level and does not supply a lot of helper methods
to simplify building a PDF, it did supply everything needed to solve
Glenn's problem on a project.
Glenn demonstrated a CGI script that was used to request a car for use by employees of a government agency. One of the important aspects of the problem was a printable receipt generated for each request. Using PDFs for the receipt provided an official looking printout that solved the customer's requirements.
Unfortunately, due to the low-level nature of the module, Glenn found himself spending a fair amount of time on issues such as aligning text and handling word-wrap manually. Despite the extra work, the module did handle everything that he needed and he was able to complete the project successfully.
Glenn, then, went on to show how he used
to make the CGI script easier to maintain by separating the HTML into
a template and keeping the code in the Perl script. Comments from the
audience provided further insight. Although it does not support all
of the bells and whistles of some of the bigger templating solutions.
HTML::Template apparently is simple to get working
quickly and can handle many tasks needed for a set of web pages.