SUMMARY: Adding filter to SPARCprinter

From: Stephen Fitzgerald (
Date: Tue Sep 07 1993 - 01:57:55 CDT

Hi all - the list comes through again.

My original question is at the end of this summary.

The solution I required turned out to be very simple to implement. All I did
was edit /etc/magic to include the ^D%! "magic number" as a type of
postscript document on the SPARCs hosting the SPARC printers.

Some people suggested the use of a dummy printer entry as a means of adding
a filter. The following is one method suggested by James Dang which can be
adpated to add filters of your choice,

1. Create a dummy printer called "lwsparc" say. You need to create a spool
   directory as well e.g. /var/spool/lwsparc

2. The /etc/printcap of the printer server will look something like :

        lwsparc|sparcdos|Sparc Laserwriter with dos filter:\

        sparc|Sun Sparcprinter NEWSprint printer:\

3. The script for /usr/local/lib/lwsparc.filt is :

        # this filter will strip off CTRL-D created in DOS environment.

                sed '1s///1' | /usr/ucb/lpr -Psparc

        Somehow you have to actually type in Crtl-D in the substitution of
        the "sed" command.

4. "lwsparc" is dummy on unix side, but should be a printing queue on dos side.

A number of people suggested editting the win.ini file
on the PCs to include CntlD=0, I have passed this fix onto our PC people.
Apparently some users were aware of it, some not.

Thanks to the following who replied. (Michael G. Harrington)
Ike Stoddard <> (Carl Hughey) (Luiz Claudio Schara Magalhaes) (Fazeel Mufti) (James Terry) (Nico Vercammen) (Syed Zaeem Hosain)
Dan Stromberg <> (Danny Johnson)
carlm@QAL.Berkeley.Edu (Carl Mason)
Benoit Lefebvre <>
James Dang <>
Mr T Crummey <> (Doug Jones) (Zdenek Dospisil)

Original Question

Hi all,
        can anyone shed some light on this problem I am having with NeWSprint
2.1 and an IPC running 4.1.2.

        Some postscript files produced from MS Windows contain Control-D as the
first character. This contrl-D causes the SPARCprinter and NeWSprint to
select the incoming file as an ASCII file, since it has not detected the
%! as the first chars in the postscript file. The PCs producing these files
are running a mix of PC-NFS, Novell and NCSA-telnet, and are on our network.

        I wish to filter out the control-D so that these postscript files will
print successfully (instead of the raw postscript).

        I have a filter which does the task I want but I cannot incorporate
it into the SPARCprinter's printcap entry. I tried a script that called my
filter, then the standard if filter, but this did not work. I tried defining
a remote printer which had as its if entry the filter I want to use, this
also failed.

        I cannot use my filter without causing the lpd_script to fail.

MY QUESTION : Has anyone else solved this problem or added a filter to the
              SPARCprinter successfully.

I will summarise.

Stephen Fitzgerald E-mail:
Maritime Operations Division Phone : +61 8 259 5992
DSTO Salisbury, South Australia Fax : +61 8 259 5139

  _--_|\ _/_/_/_/ _/_/_/_/ _/_/_/ _/ _/ _/ _/_/_/_/
 / \ _/ _/ _/ _/ _/ _/ _/_/ _/ _/
 \_.--*_/ _/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/_/_/_/
       v _/ _/ _/ _/ _/ _/_/ _/_/ _/
          _/_/_/_/ _/ _/ _/_/_/ _/ _/ _/_/_/_/

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:09 CDT