Article View: netcom.general
Article #47Re: Printing From trn?
From: Robert Hood
Date: Mon, 05 Oct 1992 01:41
Date: Mon, 05 Oct 1992 01:41
41 lines
1624 bytes
1624 bytes
In article <_4x1Hg08&9@atlantis.psu.edu> barr@pop.psu.edu (David Barr) writes:
>In article <1992Oct4.213425.3041@netcom.com> westes@netcom.com (Will Estes) writes:
>>How does one print an article from trn? Where do you set the print
>>string?
>
>| lpr
This won't work on Netcom, since our users dial in from home/work, and
don't have access to our printers.
Attached is a little C program I use to print to my local printer.
Basically, it isues a VT100 printer-on escape sequence, sends the data, then
isues a VT100 printer-off escape squence. Make sure your terminal
emulator supports this.
I call it "lprint", so from trn, I can type "| lprint", and the article will
be printed to my printer.
#include <stdio.h>
main ()
{
int in;
/* turn on printer */
putchar (27);
putchar ('[');
putchar ('5');
putchar ('i');
while ((in = getc (stdin)) >= 0)
{
putchar (in);
}
putchar (27);
putchar ('[');
putchar ('4');
putchar ('i');
}
--
Robert Hood hoodr@netcom.com (408) 554-UNIX
System/Network Administrator for Netcom On-line Communications Services
Technical Details
Message-ID:
<1992Oct5.014136.2169@netcom.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!spool.mu.edu!umn.edu!csus.edu!netcom.com!hoodrReferences:
<1992Oct4.213425.3041@netcom.com> <_4x1Hg08&9@atlantis.psu.edu>Show Full Headers
Complete Article Headers
Newsgroups: netcom.general,netcom.software,news.software.readers Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!spool.mu.edu!umn.edu!csus.edu!netcom.com!hoodr From: hoodr@netcom.com (Robert Hood) Subject: Re: Printing From trn? Message-ID: <1992Oct5.014136.2169@netcom.com> Organization: Netcom - Online Communication Services (408 241-9760 guest) References: <1992Oct4.213425.3041@netcom.com> <_4x1Hg08&9@atlantis.psu.edu> Date: Mon, 5 Oct 1992 01:41:36 GMT Lines: 41