How to print to USB printer from embedded ARM board?

Kevin Cozens kevin-4dS5u2o1hCn3fQ9qLvQP4Q at public.gmane.org
Sun Apr 1 18:08:27 UTC 2007


Peter P. wrote:
> PS can be generated but it takes 'some' work to get it right. There are
> libraries for this.

Generating the PS code wasn't my main concern. I have a vague recollection of 
having written/generated PS code many many moons ago. Most of what I need will 
probably be a bunch of moveto/lineto calls and/or the relative versions of 
those calls.

> 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).

I can probably get away without queuing the output. I'll know for sure when I 
talk some more with the client.

> 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. 

I was able to run a simple test using my USB connected printer. Using top I 
saw ghostscript using about 10MB. If some of the memory requirements are due 
to the fonts that are loaded on startup I should be able to cut that down as I 
only need one or two.

>> Any recommendations as to printing system to use (lpr, GNUlpr, LprNG, cups)?
> 
> bare gs or lpd+gs.

I will start with bare gs for now. I will have to look up the details of an 
lpr (or cups) sequence of events when printing. I wasn't sure that would work 
as lpr and cups printing systems need some sort of "printer drivers". It made 
me think I was going to need more than barebones gs.

> 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).

I'll keep that in mind. Expected errors are lack of paper/ink/toner, printer 
off-line, or printer powered-off.

> good luck,

Thanks. Hopefully I won't need it (luck that is). :-)

-- 
Cheers!

Kevin.

http://www.ve3syb.ca/           |"What are we going to do today, Borg?"
Owner of Elecraft K2 #2172      |"Same thing we always do, Pinkutus:
                                 |  Try to assimilate the world!"
#include <disclaimer/favourite> |              -Pinkutus & the Borg
--
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