Re: Creating printable reports



Russell Shaw <rjshaw netspace net au> writes:

> Daniel Kasak wrote:
>> Hi all.
>> I'm a newbie Perl developer, and I'm part-way through porting our
>> database front-ends from Access to Perl / Gtk2 ( running on Linux ).
>> We need a few printable reports that I have to rebuild. I've started
>> out doing them in a Perl CGI script, exporting an HTML 'report' and
>> firing up Mozilla to view / print them. This is less than
>> perfect. Mozilla doesn't support the @page directive, so controlling
>> pagination and headers / footers is a nightmare.
>> What options do I have with GTK / Gnome?
>> Requirements are basically headers & footers and pagination, and of
>> course Perl bindings, but I'll check this out.
>> Any takers?
>
> Haven't dealt with text processing for a while but there's a few ways:
>
> - generate the reports directly as TEX or postscript (TEX is hard to learn),
> - generate the reports in a word-processor and embed keywords

I would also mention groff.  This has some advantages over TeX, such
as being single pass, though the output isn't of such high quality.
This means you don't need to bother cleaning up temporary files or
running several times to regenerate cross-references and indices.  For
example:

FILE *output = popen("tbl | groff | lpr -P printqueue", "w");
/* lots of fprintf()s to output */
int status = pclose(output);

Of course, the GLib equivalents should be used, rather than this plain
C :-)


-- 
Roger Leigh

                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]