OK, still struggling with this stuff, and yes, I have googled it to death with mixed success. How does raw printing work exactly? Do you get to send an ascii character stream directly to the printer, and how does the printer know what to do with it? Are there any decent references anywhere?
All I am looking to do is send a few characters and line feeds, and don't care about fonts or formatting of any sophisticated sort. One would think it should be possible using lpr, but if anyone has actually done this, it might save a lot of time and experimentation.
This is just printing characters, its not real document printing, layout, all that stuff.
Peter
On 26 Nov 09:53, Peter Alcibiades wrote:
OK, still struggling with this stuff, and yes, I have googled it to death with mixed success. How does raw printing work exactly? Do you get to send an ascii character stream directly to the printer, and how does the printer know what to do with it? Are there any decent references anywhere?
All I am looking to do is send a few characters and line feeds, and don't care about fonts or formatting of any sophisticated sort. One would think it should be possible using lpr, but if anyone has actually done this, it might save a lot of time and experimentation.
This is just printing characters, its not real document printing, layout, all that stuff.
RAW printing is *exactly* that. It's a RAW print, basically every byte that is in the thing that you're sending is sent *directly* untouched to the printer. It's most useful when you have a .prn file from a windows machine that is output in the format expected by the printer and you want to print it. It's not useful for basically anything else.
Now, if you just want text output, I'd rather suggest that you forget lpr (which you should anyways - in theory that's just going to be a wrapper for lp assuming that you're using CUPS), and use a2ps.
For very basic output something like: a2ps -B -1 filename.txt
or if you've got a command outputting the data: my_command_here | a2ps -B -1
The -B says "no header", and the -1 means "1 page is 1 page" (the default is -2, which does 2 up printing, and has headers).
Hope that helps,
Brett Parker wrote:
On 26 Nov 09:53, Peter Alcibiades wrote:
OK, still struggling with this stuff, and yes, I have googled it to death with mixed success. How does raw printing work exactly? Do you get to send an ascii character stream directly to the printer, and how does the printer know what to do with it? Are there any decent references anywhere?
All I am looking to do is send a few characters and line feeds, and don't care about fonts or formatting of any sophisticated sort. One would think it should be possible using lpr, but if anyone has actually done this, it might save a lot of time and experimentation.
This is just printing characters, its not real document printing, layout, all that stuff.
why not just do
cat [filename] > /dev/lp0
you can't get much more RAW than that!
On 26 Nov 10:21, nev young wrote:
Brett Parker wrote:
On 26 Nov 09:53, Peter Alcibiades wrote:
OK, still struggling with this stuff, and yes, I have googled it to death with mixed success. How does raw printing work exactly? Do you get to send an ascii character stream directly to the printer, and how does the printer know what to do with it? Are there any decent references anywhere?
All I am looking to do is send a few characters and line feeds, and don't care about fonts or formatting of any sophisticated sort. One would think it should be possible using lpr, but if anyone has actually done this, it might save a lot of time and experimentation.
This is just printing characters, its not real document printing, layout, all that stuff.
why not just do
cat [filename] > /dev/lp0
you can't get much more RAW than that!
Ah, but that doesn't work if the printer is networked ;)
On 26/11/2009, Brett Parker iDunno@sommitrealweird.co.uk wrote:
On 26 Nov 10:21, nev young wrote:
cat [filename] > /dev/lp0
you can't get much more RAW than that!
Ah, but that doesn't work if the printer is networked ;)
Netcat ;)
Srdjan
Brett Parker wrote:
why not just do
cat [filename] > /dev/lp0
you can't get much more RAW than that!
Ah, but that doesn't work if the printer is networked ;)
of if something else happens to want to print to it at the same time, or if you want to queue another print before the first one completes, or if the printer is offline and not accepting jobs (out of paper etc)
In raw mode cups is just a spooler, and I can't think of an advantage of not having one of those.
Peter Alcibiades wrote:
OK, still struggling with this stuff, and yes, I have googled it to death with mixed success. How does raw printing work exactly? Do you get to send an ascii character stream directly to the printer, and how does the printer know what to do with it? Are there any decent references anywhere?
All I am looking to do is send a few characters and line feeds, and don't care about fonts or formatting of any sophisticated sort. One would think it should be possible using lpr, but if anyone has actually done this, it might save a lot of time and experimentation.
That should work fine then.
Set up the printer as a raw device in cups and then
lp -d printername sometextfile.txt
should work, although sending the cups test pages won't so don't do that unless you want to waste lots of paper.
In fact I was sure there was a way with something like -o raw of telling lp to print in raw mode even if it isn't set up as a raw printer, but suddenly I can't see a reference to that now.
The only other gotcha is that in some versions of cups you have to uncomment a mime type in /etc/cups/ for it to accept raw jobs.
I just did this on a SCO box (using cups because the bsd like printing in SCO is horrible) for an application that sends files to things like cheque printers and inserts all the control characters itself.
Oh and as Brett says...stop using lpr :)