Re: Output to matrix printer
| From: | Miles Thompson | Date: | Tue, 14 Oct 2008 22:15:17 +0000 |
| Subject: | Re: Output to matrix printer | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-281925@lists.php.net to get a copy of this message | ||
On Tue, Oct 14, 2008 at 6:23 PM, Dušan Novaković <ndusan@gmail.com> wrote:
> I have some request to sent text to matrix printer to print ticket for
> theater. Is it possible to do that whit some php functions? Main point
> is how to control length of paper that will be drawn inside and to
> print text on a specific place. It would be nice if somebody can write
> the code about this as example.
>
> Thnx, Dusan
>
> --
> made by Dusan
>
Decide on the font you will use - either 10 or 12 characters per inch.
A line is usually 1/8" high.
So you essentially have a matrix running at "n" characters per inch
horizontally, and "m" fractions of an inch vertically.
Fit your print into this matrix - some people do it with an array, others
just work the spaces.
Provide a "test" ticket so the operator can get the printer lined up. With
a tractor feed, after that you are good for a whole box of tickets.
Oh - one more thing - you may have to advance a number of lines so the
ticket can be torn off after printing, then reverse feed the same number.
Another tip - set your page length just to the height of the ticket.
You really want to exploit the basic native font built into the printer.
Hope this helps - Miles