in reply to Generating PDF

Instead of directly writing PDFs, you also might want consider to write a TeX/LaTeX file, which easily can be converted to a pdf with LaTeX. If you're on gn*x, I would check out the tetex package (find it on freshmeat.net).

The advantage of such an approach is, that you can have quite high-level control (ie, just write your text). However, learning about all the handy packages can take quite a while. A sample perl script might be something like this:

#get the data first $a = <DATA>; chomp $a; $b = <DATA>; chomp $b; open TEX, ">file.tex" or die "Could not open file.tex"; print TEX <<'_END'; \documentclass{article} \begin{document} \title{TeX-report} \author{Me} \maketitle \section{Some data} _END print TEX "I have $a and $b. That's all for now.\n"; print TEX <<'_END'; \section{Some table} \begin{table} \caption{A table} \begin[|l|c|c|]{tabular} \hline _END while(<DATA>){ chomp; print TEX join('&', split ).'\\ \hline'."\n"; } print TEX <<'_END'; \end{tabular} \end{table} \end{document} _END system("latex file.tex"); system("latex file.tex"); system("dvipdf file") if -e "file.dvi"; __DATA__ 129873 12315 1 8 2 1 3 100 8 3 4

Here I'm also using the dvipdf package, (freshmeat.net), but you could use 'dvips file -o' and 'ps2pdf file.ps' as well. Perl code is checked. I'm using TeX daily, so you always can /msg me with further questions.

Hope this helps,

Jeroen
"We are not alone"(FZ)

Replies are listed 'Best First'.
Rea: Generating PDF
by baku (Scribe) on Feb 20, 2001 at 19:57 UTC

    Another option might be to generate XSL:FO, which can be converted into PDF by e.g. FOP (c/o http://xml.apache.org/); this is an XML dialect, so you can actually just output XML and use an XSL:Transform stylesheet to convert the same XML into HTML, WML, or XSL:FO (for conversion to PDF)... Big points for Laziness :-)