Re: Creating printable reports



On Wed, 21 Jul 2004 08:46:36 +1000, Daniel Kasak
<dkasak nusconsulting com au> wrote:
> 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.

I do this by generating latex and using pdflatex to render PDF files.
PDF is handy because it gives you good control over paper size and
orientation. In perl it's something like:

print TEXSOURCE <<LATEX_END;
\\documentclass{article}
\\usepackage{times}
\\usepackage[none]{hyphenat}
\\usepackage[dvips=false,pdftex=false,vtex=false]{geometry}
\\geometry{
        paperwidth=${poster_width}cm,
        paperheight=${poster_height}cm,
        margin=${inner_margin}cm,
        noheadfoot
}
\\usepackage[width=${paper_width}cm,height=${paper_height}cm,center,pdftex]{crop}
\\usepackage[pdftex]{graphicx} 
\\pagestyle{empty} 
\\begin{document}
blah blah blah ${mystuff} etc
\\end{document}
LATEX_END
system "pdflatex texsource && cp texsource.pdf $output_dir/${file_name}.pdf";

I'm typsetting posters. If you're just generating A4 or US Letter you
can skip a lot of the  pagesize/margin/rotate stuff.

John



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