groff
[Top][All Lists]
Advanced

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

Re: One groff file outputting multiple pdfs?


From: Robert Thorsby
Subject: Re: One groff file outputting multiple pdfs?
Date: Fri, 20 Nov 2020 10:01:54 +1100

On 20/11/20 09:32:03, Richard Morse wrote:
> On Nov 19, 2020, at 5:11 PM, Heinz-Jürgen Oertel <hj.oertel@t-online.de> wrote: > Can you use pdftk to split the groff output file file afterwards in pages?

Unfortunately each center’s invoice is a different, arbitrary, number of pages. The file internally knows when it becomes a new one, but that information is not fixed (there are listings of items, so sometimes a center could be one page, sometimes 5 (or any other number)).

This is why I was hoping that there is something internal to groff that would let me change the output file…

Hi Richard,

I suspect you are going about this the wrong way. Why not interrogate your database and then pass the data to your favourite text parsing program to pipe it through groff to typeset your invoices?

Is there any reason why groff should be used only once, and not once for each invoice?

Having said that, you can easily control the content of your invoice(s) by using defined strings as triggers. For example, in my invoices, I set a variable as a string at the start of the file:

.ds Date_Paid_In_Full

I then add a macro that creates a facsimile of a "PAID"  rubber stamp.

At the end of the groff input file I test the Date_Paid_In_Full string; if null I tell client to pay; otherwise it executes the "PAID" stamp macro.

Using this, and similar techniques, you can create a heap of boilerplate text and print only that which applies to any particular invoice.

I assume you are already using tbl [-t] to allow for multi-page invoices.

Robert


reply via email to

[Prev in Thread] Current Thread [Next in Thread]