On Tue, 31 Oct 2000, Robert Speed wrote:

> Quick question people.
> 
> I'm attempting to send text output to a HP Laserjet 2 printer.
> However, the output is stepped.
> 
> This, I understand, is due to incorrect filtering;
> I've tried setting up ifhp, and setting "filter=" and/or "if=" to it, but to 
> no avail.
> I've tried the basic perl script, thus;
> 
> #!/usr/bin/perl
> while(<STDIN>){chop $_; print "$_\r\n";};
> 
> This doesn't work either, yet it works perfectly well if I run the script 
> manually.
> i.e. I create a crlf'd file using the perl script, and then send that to 
> the printer...
> 
> All the paths, permissions, etc are correct.
> 
> Anyone any ideas ?

The approach the magic filters take is to not translate the end of line
behavior, but rather if it is noticed that the file appears to be
text, the prepend the Escape sequence to reset the printer and put it
into EOL=CRLF (DOS) mode and append the escape sequence to reset the
printer.  Personally, for your approach I would have used chomp()
instead of chop().  I can't see any obvious problems with the script,
maybe someone else can.  One idea springs to mind, how is your
filter being invoked by lpr/lpd?  Is it being given a <STDIN> of
your file to be processed, or is lpr/lpd giving it any argument
of a file to process?  Maybe look at $0 and your @ARGV to see
how it is being invoked (write those details to a log file you
open in /tmp or something).

Gord

Matter Realisations     http://www.materialisations.com/
Gordon Haverland, B.Sc. M.Eng. President
101  9504 182 St. NW    Edmonton, AB, CA  T5T 3A7
780/481-8019            ghaverla @ freenet.edmonton.ab.ca
780/993-1274 (cell)


-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to