kd7ilk has asked for the wisdom of the Perl Monks concerning the following question:

I have tried with limited success using perl in combination with text::template and latex to generate a professional report. (This may be due to may lack of latex knowledge.) Is there a better approach or different software that will fill the content and produce a professional pdf document more efficiently? Document requirements are: Table of contents, List of figures, tables, appendix, header, footer, cover page, page numbers, graphics/pictures with captions. Currently using perl on a linux box and data mining the content of the document to fill report.
  • Comment on What is the best way to produce a formal pdf report autonomously?

Replies are listed 'Best First'.
Re: What is the best way to produce a formal pdf report autonomously?
by karlgoethebier (Abbot) on Sep 10, 2013 at 18:12 UTC

    Using Text::Template and LaTeX isn't a bad idea for creating reports. BTW, what does "autonomously" mean in this context?

    Update:

    Instead of one of the templating modules you can also use this technique i cheated a while ago:

    #!/usr/bin/env perl + use strict; use warnings; undef $/; my %vars = ( name => qq(Karl), color => qq(blue), fruit => qq(tomato) ); my $string = <DATA>; $string =~ s/%%(.*?)%%/$vars{$1}/gs; print $string; __DATA__ Hello, my name is %%name%%! + May i have a %%color%% %%fruit%% please?

    Perhaps i posted this already but cannibalisation isn't a bad idea :-)

    Please see also Re: Creation of PDF.

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

Re: What is the best way to produce a formal pdf report autonomously?
by Corion (Patriarch) on Sep 10, 2013 at 15:14 UTC

    As you don't tell us what your problems with the LaTeχ approach are, it's hard to give good advice on how to proceed.

    Personally, I would look at producing the appropriate HTML files instead of LaTeχ if that is easier. Both are still simply text files.

    I think that LaTeχ still has the best facilities to automatically generate a table of contents, list of figures etc., but you can always program these yourself. I am unaware of any "framework" or set of libraries that is geared towards report production which has readymade reporting features like you seem to want. I would also look at Crystal Reports or Microsoft Access - these are applications geared mainly towards report generation and they have far more ways of producing fancy charts.

Re: What is the best way to produce a formal pdf report autonomously?
by ww (Archbishop) on Sep 10, 2013 at 15:09 UTC
    • Super Search this site for prior references to some or all of your pdf terms
    • Big G: site:cpan.org pdf (and related) just for starter; brain-freeze on search cpan for all pdf modules
    • ppm:
       1: Acme-PDF-rescale 0.2
       2: CAM-PDF 1.60
       3: CAM-PDF-Annot 0.06
       4: CAM-PDF-Annot-Parsed 0.01
       5: PDF 111
       6: PDF-API2 2.020
       7: PDF-API3 3.001
       8: PDF-Boxer 0.004
       9: PDF-EasyPDF 0_04
      10: PDF-Extract 3.04b
      11: PDF-FromImage 0.000003
      12: PDF-Imposition 0.03
      13: PDF-Labels 0.01
      14: PDF-Report 1.36
      15: PDF-Report-Table 1.01
      16: PDF-ReportWriter 1.5
      17: PDF-Reuse 0.35
      18: PDF-Reuse-OverlayChart 0.03
      19: PDF-Reuse-Tutorial 0.11
      20: PDF-Table 0.9.6_h3
      21: PDF-Writer 0.06
      22: PDF-Xtract 0.08
      23: PDFREP 2.20
      24: Pod-Pdf 1.2
      25: Template-Flute-PDF 0.0042
      26: Test-PDF 0.01
      27: Text-PDF 0.29a
      28: WebService-Trynt-PDF 0.01
      29: Wx-PdfDocument 0.13
      30: perl-pdf 0.06.1b-SREZIC-3
      31: pod2pdf 0.42

    ... and read the docs. Perhaps some of these approaches will be helpful.