All the PDF libraries for Perl seem a bit barbaric -- stuck in the 1980's. You have to specify PostScript points to do layout. Java has JasperReports, Ruby has Prawn, and Python has ReportLab. Is there a non-extinct library/module that will let me make a nice looking PDF in less than a week of coding? (I'm a little frustrated by PDF::API2, PDF::Table, etc.) I don't want to generate HTML and convert it. Perl is ideal for reporting, but the main report file format is not available in a usable way. What libraries do people use?
I need:
I'm slightly open to wrapping external (non-Perl) open source tools, if absolutely needed. But not really interested in a major Java server approach. For the bounty, I want a pure Perl approach, since I want to run this on a server that I can't add more than modules to. If you have a public example that works well, please point me to it.
Using Perl, generate LaTeX, perhaps using Template::Toolkit, then call the compiler, either TeXLive or MikTeX or whatever distribution you need for your OS. There is an extension called Template::LaTeX, though you probably don't need it, which manages the build process.
LaTeX has support for all the things you need. Tables get a little interesting but there are some modern table packages which ease things (I think that its called ltxtable
). For charts (do you mean diagrams) there is a sub language called TikZ
which is spectacularly powerful.
This really is a very easy workflow, especially if you want the results to be similar every time (i.e. can use a template). In fact it really is not unlike creating HTML from a template and serving it to a browser.
Another benefit of this is that the template (and prepared source) will be portable should you need to build a report in another language.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With