*BSD News Article 78010


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!solace!news.stealth.net!vixen.cso.uiuc.edu!newsfeed.internetmci.com!in2.uu.net!news1.erols.com!news
From: Ken Bigelow <kbigelow@www.play-hookey.com>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Printing problem with Okidata OLE600.
Date: Tue, 10 Sep 1996 21:05:32 +0000
Organization: Erol's Internet Services
Lines: 83
Message-ID: <3235D81C.47E6@www.play-hookey.com>
References: <01bb9e93$2739c860$9bc4abc7@glen> <3234727C.6028@www.play-hookey.com> <01bb9f94$4e7e5920$7ac4abc7@glen>
Reply-To: kbigelow@www.play-hookey.com
NNTP-Posting-Host: kenjb05.play-hookey.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0 (Win16; U)

Glen wrote:
> 
> I don't know how to do that.  Do you have any sorce for that problem or
> anyone else.

I don't want to seem mean here, but if you're going to be actively using
*any* flavor of U*ix, including FreeBSD, you're going to have to expect
to do some programming. I'm not going to try to teach you how in one
easy lesson, nor can I or anybody else do all of your work for you.

However, I will start you off -- what you need to create is a filter
file to be specified in /etc/printcap for your printer. Depending on
what else you may want to do, you may have to add to this beginning, but
the essential code to insert a Carriage Return (CR) in front of every
Line Feed (LF) is:

#include <stdio.h>

char thisChar;			/*Define a variable		*/

thisChar = getchar();		/*Get character from stdin	*/
if (thisChar == '\x0a') {	/*Got LF?			*/
	putchar('\x0d');	/*If yes, send CR first		*/
}
putchar(thisChar);		/*In any case send the character*/


If this seems like Greek to you, you'll need to find a book or two on
the C language and start studying. The above code fragment may actually
be enough for your needs -- just turn it into a main() function and
compile it.

For further information, start by checking the man pages for gcc and the
Handbook on printers for info on printcap and filter files.

As I said before, I'm not trying to be mean. Unless you learn to use
this stuff for yourself, you'll always have to depend on someone else to
do it for you, and I can guarantee that nobody on this newsgroup is
willing to go that route. We'll help, and offer both advice and
suggestions, but you'll have to do the bulk of the work yourself. It's
not always easy (ande wouldn't be worth it if it was), but it's a hell
of a lot mofre satisfying this way!


> 
> Ken Bigelow <kbigelow@www.play-hookey.com> wrote in article
> <3234727C.6028@www.play-hookey.com>...
> > Glen wrote:
> > >
> > > This is my /etc/printcap!
> > >
> > > oki|lp|okidata laser:\
> > > :lp=/dev/lpt0:sh:sd=var/spool/lpd/oki:\
> > > :if=/usr/local/libexec/okiif:
> > >
> > > I have created the /var/spool/lpd/oki and chown to daemon.
> > > This is the filter file I'm using.
> > >
> > > printf "\033\&k2G" && cat && printf "\f" && exit 0
> > > exit 2
> > >
> > > When I print I still get the stair case effect!!!!
> > > My next problem is my printer only prints the first few  print requests
> > > then when I send another print job it prints blank pages only a couple.
> > > Then I check the  que and it has been processed.   If the system is
> > > shutdown the printer will print a few more requests.   Then it will
> start
> > > printing blank pages for each request.
> > >
> >
> > Sounds like the classic LF-without-CR problem on the printer. If you
> > can't set your printer to automatically do a CR when it reads LF, you'll
> > have to add a short (C or other language) routine to check each
> > character and send a CR prior to each LF.


-- 

Ken

Are you interested in   |
byte-sized education    |   http://www.play-hookey.com
over the Internet?      |