in reply to Producing documents using Perl

I'll tell you what I would Not recommend... that would be, generating troff/groff/nroff code directly from your Perl script, and using groff to turn it into postscript. Yikes, what a PITA that was! I guess I'm just not old-school enough.

Better would be to check out some of the many PDF modules in CPAN.

Update: My output wasn't simple enough. It had multiple tables, with word-wrapping within a single column in the table, embedded postscript, different font sizes and styles, etc. I figured it all out and it worked in the end; but by now I'm Sure there's an easier way.

Alan

Replies are listed 'Best First'.
Re: Re: Producing documents using Perl
by buckaduck (Chaplain) on Mar 04, 2002 at 20:32 UTC
    Bah. It's trivially easy if your output is simple enough. For plain text, just use blank lines to separate paragraphs, and put the following line at the beginning of your output:
    .LP
    
    Then, run your output through the following program: (By default, it will output PostScript in 10-point Times Roman font. Of course, fonts and sizes can also be easily changed.)
    groff -ms

    Was that so hard? But wait, there's more...

    If you're interested in putting a box around a paragraph:

    .B1 paragraph text .B2
    And in general, lines and boxes are easily created using the pic preprocessor. It's automatically invoked by providing the -p option to groff. A simple example:
    .PS box "boxed text"; arrow; circle "circled text" .PE

    Don't be afraid.

    buckaduck