in reply to Creating PDF files with Perl

I have had success creating pdf files by first creating an svg document for each page, then converting to pdf using inkscape's svg2pdf tool, I then joined all the separate pdf files into one multi page document using pdftk

On that occasion the SVG file was created via a template. You could also look into GD::SVG