Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!decvax!ucbvax!laser-lovers From: laser-lovers@ucbvax.UUCP Newsgroups: mod.computers.laser-printers Subject: Re: Programming LN03 question. Message-ID: <8512151839.AA07557@topaz.rutgers.edu> Date: Sun, 15-Dec-85 13:39:12 EST Article-I.D.: topaz.8512151839.AA07557 Posted: Sun Dec 15 13:39:12 1985 Date-Received: Mon, 16-Dec-85 23:11:33 EST References: <8512121657.AA13245@ucbvax.berkeley.edu> Sender: spp@ucbvax.BERKELEY.EDU Reply-To: grr@unirot.UUCP (George Robbins) Organization: The Soup Kitchen, Piscataway NJ Lines: 143 Keywords: LN03 filter Approved: laser-lovers@washington.arpa Summary: Simple LN03 Filter In article <8512121657.AA13245@ucbvax.berkeley.edu> MRL%PFCVAX@MIT-ZERMATT.ARPA writes: >I'm looking for some help in programming an LN03. I've been trying to use the >fonts that come with the machine in the opposite direction from what the >default is, i.e. specifying LANDSCAPE rather than PORTRAIT. > Mark London I have this feeling that the extra memory module is exactly what you need. We have several LN03's at Commodore used mostly for word processing and in place of a line printer on our unix system. I have no complaints about the LN03's butthe preliminary manual they were shipped with has to set a new low for utility. It gives all the details, but tells you nothing. I guess they assume that you just read a LN03 concepts and features manual or something. Anyway, I am not sure how to do what you want, however I would like to offer this little filter that I wrote. It allows you to select one of the two ?nn fonts that seem to be intended as default fonts for portrait or landscape mode printer emulation. If anyone knows how to make the printer power up with these modes I would really like to hear about it. The program acts a standard unix filter, meaning it can be used to print a file directly on the printer, or piped in between pr and lpr. It processes the command line sequentially. When it sees a -P or -L switch, it sends a control string to switch to portrait or landscape mode respectivly. When it sees a file name, it copies the file to stdout. If no file names were specified, it copies stdin to stdout, and finally sends the string to reset the printer to default power-up format. I had originally intended to implement lots of switches to allow specifying all the various printer parameters, but found that the -P and -L choices did all that I needed, so I quit while I was ahead. Use of getopt would probably make the program much simpler, but I was blissfully unaware of that flamewar when I wrote this. -------------------------------------------------------------------------------- /* * ln03 A simple filter to make a DEC LN03 into usable printer... * * ln03 -P file... Portrait Mode * ln03 -L file... Landscape Mode * ln03 file... Why Bother * * No Rights reserved, this program is cast upon thee winds of fate since * it took longer to figure out the LN03 manual than to write the program. * * George Robbins 9/85 - ihnp4!cbm!grr * */ #include int didfile; main(argc,argv) int argc; char *argv[]; { int argn; didfile = 0; for (argn = 1; argn < argc; ) argn = doarg(argc, argv, argn); if (didfile == 0) dostdin(); printf("\033[!p"); fflush(stdout); } int doarg(argc, argv, argn) int argc; char *argv[]; int argn; { char *argp; char argl; argp = argv[argn++]; if (*argp++ != '-') { dofile(--argp); didfile++; } else while(argl = *argp++) argn = doswitch(argc, argv, argn, argl); return(argn); } int doswitch(argc, argv, argn, argl) int argc; char *argv; int argn; char argl; { int targ; switch(argl) { case 'L': printf("\033[?21 J\010\033[15m\033[5;255s"); break; case 'P': printf("\033[?20 J\010\033[12m\033[13;255s"); break; case 'l': case 'p': default: fprintf(stderr,"invalid switch -%c\n",argl); } return(argn); } int dofile(argp) char *argp; { FILE *input; int c; if (input = fopen(argp, "r")) { while ((c = fgetc(input)) != EOF) putchar(c); fclose(input); } else fprintf(stderr,"can't open %s\n",argp); } dostdin() { int c; while ((c = getchar()) != EOF) putchar(c); } -- George Robbins uucp: {unirot|tapa}!grr P.O. Box 177 Lincoln U, PA 19352 [Any ideas herein are not responsible for themselves!] --- George Robbins uucp: {unirot|tapa}!grr P.O. Box 177 Lincoln U, PA 19352 [Any ideas herein are not responsible for themselves!]