I think you should take a look at outputting to an HTML document. Perl has lots of tools for this and you can make graphs in a variety of ways. Simple bar graphs can be made by resizing a 1x1 pixel gif image and placing it and labels in a table.


Or, for more complex graphs, I've used GDGraph.pm (I think that's the name) and it worked great too. If I recall, it does pie charts, bar and line charts and maybe some others too.

Sherm Pendley's "Fat Camel" and "GraphicsKit" has most of what you need to create images on the fly with perl, so you may want to take a look at that too.

You can always print the html doc to a PDF file using the standard "Print" command and it would seem to me that you should be able to print a saved document to PDF with a perl only solution, but I've never tried. If not, you should be able to find an AppleScript that can batch print a folder or list of documents that can be called from a perl script.


Thanks Bill and thanks to everyone who responded. An excellent gang! I think the consensus is ...

(1) I probably don't want to go directly to PDF; I need to create something else (something easier) and then, if I still want, convert or print to PDF.
(2) Interim formats include HTML, XML, and LaTex, and maybe PostScript, in order of increasing complexity/learning curve
(3) All of the above can be done with free stuff (super)
(4) Perl _is_ probably a good solution for this, as opposed to PHP or another scripting language


My output is charts like a collection of lists or tables, not graphs (yet), and it sort of resembles an invoice in some respects. It's essentially data extracted from MySQL, printed out nicely. A bitmap may be thrown in here or there, like a logo. I'm thinking that HTML & tables may be the easiest way; LaTex I have to research more.



Reply via email to