*BSD News Article 78108


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!www.nntp.primenet.com!nntp.primenet.com!enews.sgi.com!news.mathworks.com!newsfeed.internetmci.com!in2.uu.net!news.cybercomm.net!usenet
From: "Glen" <gi143@cybercomm.net>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Printing problem with Okidata OLE600.
Date: 11 Sep 1996 23:02:20 GMT
Organization: CyberComm Online Services
Lines: 93
Message-ID: <01bba11e$bf0cd280$81c4abc7@glen>
References: <01bb9e93$2739c860$9bc4abc7@glen> <3234727C.6028@www.play-hookey.com> <01bb9f94$4e7e5920$7ac4abc7@glen> <3235D81C.47E6@www.play-hookey.com>
NNTP-Posting-Host: sl-033.sl.cybercomm.net
X-Newsreader: Microsoft Internet News 4.70.1155

This is what I can up with!

#include <stdio.h>

main ()

{
	int c;
		while (( c = getchar()) != EOF)
	{
		if ( c == '/n')
		putchar(13);
		putchar(c);
	}
return (0);
}

My new problem!!!!!!!!!  This is my filter file.

/bin/cat | theaboveprogram > Now I don't know what to do.  How do I write
this filter file.  I have tryed all different things.

Thank You.

I do know a little C.  Just don't know how to imply it well.




> 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*/
> 
> 
> > 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?      |
>