in reply to Generating multi page PDF with bitmap images, vector graphics and text.

Thank you tod222 and roboticus for your input.

After careful consideration, I decided to go for drawing my SVG templates in inkscape, adding template tags into the xml by hand, and then using Text::Template to fill in the template for each page to generate the SVG for each page, which then gets converted to PDF and joined into one big PDF via pdftk.

The final PDF file weighs in at about 300 megs, takes a while to render and probably contains a fair bit of waste, but it does what I need it to do. Disc space is cheap and I don't expect to email the thing any time soon.

One small glitch with using a templating system, is that on occasion I would like some elements of the SVG to not appear at all, and it does not appear to be possible to hide an element by template, nor is there a 'visible' property in SVG. (at least I can't find one), that would let me hide things. Instead I will probably end up controlling the colour of object by the template, and change their colours to transparent if I want to hide them.

tod222: You suggested I might consider TeX, Postscript, DVI or ODF. The reason I did not consider them (apart from familiarity) is that while I am developing, I want to be able to preview what the script has created, and PDF or SVG are very good for that. Also while there are a great number of modules on CPAN for those formats, not many of them looked that useful. The first page of the CPAN search for postscript contains such gems at PostScript::Graph::Paper, PostScript::MailLabels and PostScript::CDCover. All very useful modules I am sure, but only if you are trying to solve those specific problems. Sometimes a large number of search results from CPAN is a bad thing, if you are trying to solve a problem quickly, and you have to many choices to evaluate.

  • Comment on Re: Generating multi page PDF with bitmap images, vector graphics and text.