How to print to USB printer from embedded ARM board?

Peter P. plpeter2006-/E1597aS9LQAvxtiuMwx3w at public.gmane.org
Sun Apr 1 01:59:36 UTC 2007


Kevin Cozens <kevin at ...> writes:

> The easiest way to provide support for printing some text and some line graphs 
> would be for the program to generate Postscript code and pass that to a 
> typical Linux printing system based on lpr (or an lpr variant) or even CUPS 
> along Ghostscript and (possibly) a2ps.

PS can be generated but it takes 'some' work to get it right. There are
libraries for this.

> Does anyone happen to have a general idea how much disk space an Lpr/CUPS with 
> Ghostscript printing system would need? I don't need to support all printers 
> at once. The packages could be stripped down so that only one printer is 
> supported at any given time. Similarly with fonts as only a few of the basic 
> ones would be made available.

lpr (actually lpd) has the smallest footprint but you only need it if you want
to do queued printing. Else simply use gs with stdout connected to a printer (or
specify the output device).
 
> How much memory might be required by the printing process to (mainly for 
> Ghostscript) while generating the data to be sent to the attached printer from 
> the passed Postscript code?

gs is huge, it uses huge fonts, and it will need about 8M or more just to start
up with one page. gs typically builds an entire image of the output in ram
before outputting it. Thus a single page monochrome in ram at 1bpp will require
 about 6MB. So 16MB should be barely enough to print a page. 
 
> Any recommendations as to printing system to use (lpr, GNUlpr, LprNG, cups)?

bare gs or lpd+gs.
 
> Are there any other thoughts or concerns I should be considering that I might 
> have overlooked?

The daemon and gs will get stuck sometimes, when something unexpected happens to
the printer and/or to the queue (or when the PS code contains errors). Make sure
you have a procedure to 'unstick' a stuck job. This includes flushing any temp
files from spools etc (and consider that a flushed job may be lost).

good luck,
Peter P.

--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list