* Using filters with lpd
@ 1996-09-27 4:00 Craig A. Lavender
1996-09-27 4:00 ` Gregory Neil Shapiro
0 siblings, 1 reply; 3+ messages in thread
From: Craig A. Lavender @ 1996-09-27 4:00 UTC (permalink / raw)
Hi,
Since our building only has Apple Laserwriters, I am forced to write a
print filter for our DEC Unix 3.2D machine to convert linefeeds to
carriage-return-linefeeds. However, when I write the filter and place a
reference to it in my printcap file, it doesn't seem to work (linefeeds
are still linefeeds). When I reprogramm the filter to copy the
incoming stream on stdin to /dev/console, nothing seems to enter the
filter at all. My two questions are:
1) Does anyone know why this wouldn't work? I know I'm probably not
providing enough info, but does anyone have any suggestions?
2) Why, if I know the filter is not sending anything through, does
output still get sent to the printer?
Below are copies of my filter program and my printcap entry:
lf2crlf.c:
--------
#include <stdio.h>
#define STRING_SIZE 501
int main()
{
char s[STRING_SIZE];
while (fgets(s, STRING_SIZE, stdin) != NULL)
{
int len = strlen(s);
s[len-1] = '\0'; # get rid of trailing '\n'
printf("%s\r\n", s);
}
}
printcap:
---------
# LaserWriter 16/600 PS in Dole 3090
lp|lp0|0|spedlab:\
:lf=/var/adm/lperr:\
:lp=:\
:of=/usr/lib/filters/lf2crlf:\
:rm=spedlab:\
:rp=spedlab:\
:sd=/var/spool/spedlab:
Please respond to my email address below {instead of,in addition to} the
list.
Thanks in advance,
Craig
--
----------------------------------------------------------------------
Craig A. Lavender craig@scrtec.rtec.org
Technical Coordinator 913-864-0705
South Central R*TEC http://scrtec.rtec.org/
University of Kansas "I use tech to teach"
----------------------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Using filters with lpd
1996-09-27 4:00 Using filters with lpd Craig A. Lavender
@ 1996-09-27 4:00 ` Gregory Neil Shapiro
1996-10-02 4:00 ` Angelo MAGGIORA
0 siblings, 1 reply; 3+ messages in thread
From: Gregory Neil Shapiro @ 1996-09-27 4:00 UTC (permalink / raw)
To: craig
craig> 1) Does anyone know why this wouldn't work? I know I'm probably not
craig> providing enough info, but does anyone have any suggestions?
craig> 2) Why, if I know the filter is not sending anything through, does
craig> output still get sent to the printer?
craig> printcap:
craig> ---------
craig> # LaserWriter 16/600 PS in Dole 3090
craig> lp|lp0|0|spedlab:\
craig> :lf=/var/adm/lperr:\
craig> :lp=:\
craig> :of=/usr/lib/filters/lf2crlf:\
craig> :rm=spedlab:\
craig> :rp=spedlab:\
craig> :sd=/var/spool/spedlab:
Remote printer queues don't run filters on the local machine. The filter will
have to be placed on spedlab.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Using filters with lpd
1996-09-27 4:00 ` Gregory Neil Shapiro
@ 1996-10-02 4:00 ` Angelo MAGGIORA
0 siblings, 0 replies; 3+ messages in thread
From: Angelo MAGGIORA @ 1996-10-02 4:00 UTC (permalink / raw)
Cc: maggiora
Gregory Neil Shapiro wrote:
>
> craig> 1) Does anyone know why this wouldn't work? I know I'm probably not
> craig> providing enough info, but does anyone have any suggestions?
> craig> 2) Why, if I know the filter is not sending anything through, does
> craig> output still get sent to the printer?
>
> craig> printcap:
> craig> ---------
> craig> # LaserWriter 16/600 PS in Dole 3090
> craig> lp|lp0|0|spedlab:\
> craig> :lf=/var/adm/lperr:\
> craig> :lp=:\
> craig> :of=/usr/lib/filters/lf2crlf:\
> craig> :rm=spedlab:\
> craig> :rp=spedlab:\
> craig> :sd=/var/spool/spedlab:
>
>> Remote printer queues don't run filters on the local machine. The filter will
>> have to be placed on spedlab.
The suggested solution is impossible if the printer has a built-in
TCP/IP inteface like HP LaserJet 4M.
To solve the problem install enscript, the gnu version of Adobe
TranScript, written by Markku Rossi, and redefine the commands lpr using
an alias like:
alias lpr '/usr/local/bin/enscript --fancy-header=a2ps -DDuplex:true -Z
$*'
see the manual for definitions.
With -Z enscript work as a filter for ascii and postscript files and $*
pass the lpr parameter to enscript.
--
_\|/_
_____________________________oOO__@!@__OOo_________________________
/ / /\ / / / ___/ /\ / / Angelo MAGGIORA
/ / / \/ / / / / \/ / INFN - Via P. Giuria 1
/ / / /\ / / __/ / /\ / 10125 Torino - Italy
/ / / / \/ / / / / \/ tel: ++39 11 6707 418/415
ISTITUTO NAZIONALE fax: ++39 11 6699 579
FISICA NUCLEARE e-mail: maggiora@to.infn.it
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1996-10-02 4:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-09-27 4:00 Using filters with lpd Craig A. Lavender
1996-09-27 4:00 ` Gregory Neil Shapiro
1996-10-02 4:00 ` Angelo MAGGIORA
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox