Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Generating beautiful reports

by Corion (Pope)
on Apr 09, 2002 at 08:39 UTC ( #157679=note: print w/replies, xml ) Need Help??


in reply to Generating beautiful reports

What you want to do really screams for a templating engine, as the only thing that changes per document is the data from the web form.

Personally, I wouldn't create the images with GD but create PDFs from LaTeX, as LaTeX gives a lot of flexibility and a nice layout. The sooner you go away from overlaying text onto a pretty picture, the easier it will be.

The only problem is, of course, if the pretty background picture is something you cannot change/influence. Then, TeX is out of the window, as you'd then have to describe the fields as locations to TeX, which is no more fun than describing them to GD.

Have a look at TT2, which is, AFAIK, a general templating system (opposed to a templating system geared for HTML) and what TeX output you can get from there. The rest, spawning off LaTeX to create a temporary PDF and redirecting the user to that PDF file is then fairly simple.

perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web

Replies are listed 'Best First'.
Re: Re: Generating beautiful reports
by kappa (Chaplain) on Apr 09, 2002 at 10:30 UTC
    Yes, of course I want a templating engine :) And I'd love to use LaTeX to produce PDFs. I have a fairly extensive LaTeX experience. And there's a gotcha:
    LaTeX isn't really that good on documents where you want some absolute positioning. It is not much easier to convert an invoice form from a pretty looking Excel sheet to a LaTeX source than to a series of GD primitives. What LaTeX would make easy are justified paragraphs, anti-aliased text and the like. But, e.g., LaTeX tables are pretty awkward and there's usually a good amount of hassle in trying to convert a big Excel table to a LaTeX table.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://157679]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2020-06-07 06:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (42 votes). Check out past polls.

    Notices?