[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dynamic Paperlength for PS or PDF device
From: |
G. Branden Robinson |
Subject: |
Re: Dynamic Paperlength for PS or PDF device |
Date: |
Thu, 8 Dec 2022 11:19:49 -0600 |
Hi Wim,
At 2022-12-08T15:51:07+0100, Wim Stockman wrote:
> I am making a simple cash register with a ticket printer. and I want
> to figure out how I can detect how long my physical paper should be
> without cutting some text off. So I can set it for the device. The
> width is fixed so that is no issue. Eventually I can run it in some
> loop and detect when it stops having more than one page.
I reckon I would have a couple of macros that open and close a
diversion, then measure against an argument that specifies the limit
imposed by the hardware (i.e., length of paper roll remaining).
Here's a conceptual sketch.
.de StartTicket
. br
. di Ticket
..
.
.de EndTicket
. di
..
.
.while 1 \{\
. StartTicket
.\" input for ticket text goes here
. EndTicket
. if (\n[dn] > \n[ticket-printer-paper-length]) \
. ab ticket too long for remaining paper; aborting
.\}
Please clarify if I've overlooked a requirement.
Regards,
Branden
signature.asc
Description: PGP signature
- Dynamic Paperlength for PS or PDF device, Wim Stockman, 2022/12/08
- Re: Dynamic Paperlength for PS or PDF device,
G. Branden Robinson <=
- Re: Dynamic Paperlength for PS or PDF device, Deri, 2022/12/08
- Re: Dynamic Paperlength for PS or PDF device, Wim Stockman, 2022/12/09
- Re: Dynamic Paperlength for PS or PDF device, John Gardner, 2022/12/09
- Re: Dynamic Paperlength for PS or PDF device, Ralph Corderoy, 2022/12/10
- Re: Dynamic Paperlength for PS or PDF device, John Gardner, 2022/12/10
- Footie. (Was: Dynamic Paperlength for PS or PDF device), Ralph Corderoy, 2022/12/10
- Re: Dynamic Paperlength for PS or PDF device, Wim Stockman, 2022/12/10
- Re: Dynamic Paperlength for PS or PDF device, Wim Stockman, 2022/12/14
- Re: Dynamic Paperlength for PS or PDF device, Oliver Corff, 2022/12/14
- Re: linking/compile error / Dynamic Paperlength for PS or PDF device, G. Branden Robinson, 2022/12/09