(Answer) (Category) Linux on PowerPC FAQ-O-Matic : (Category) System Configuration : (Category) Printing :
How do I print to my Stylewriter?
LinuxPPC 4 seems to have support built-in for the StyleWriter. I've printed some PostScript docs from my computer to my StyleWriter on the printer port by specifying 'stylps' as the printer under the Setup... button in the print dialog box (KDE). The old UNIX trick of setting the PRINTER environment variable worked for me from the command line as well (set the variable in your favorite shell, then use lpr <filename>). Look at the /etc/printcap file for the nickname of your printer appropriate to the type of file you are printing, text or postscript (I found lp, stylps and cstylps), then use that in your print setup dialog or environment variable.
kcary@pepperdine.edu
I wanted everyone to know that I have put together an rpm that should allow you to set up your Stylewriter for printing without manually installing the components. The rpm is available on ftp.linuxppc.org in /devel/RedHat/RPMS as lpstyl-0.9.7-1A.ppc.rpm. You will also want to install lpr-0.21-2A.ppc.rpm, ghostscript-3.33-5B.ppc.rpm and ghostscript-fonts-5.0-1.ppc.rpm from the same directory. Lastly you will need the rpm enscript-1.5.0-1A.ppc.rpm in /devel/old/contrib/howarth there. Install all of those (you can skip ghostscript if you have a newer version (4.x or 5.x). IMPORTANT! This lpstyl rpm assumes you are running the latest wip kernels or DR3 which map the printer port to cua1 like linuxppc/linuxpmac. Please upgrade to that kernel level...its good for you. You may want to kick the lpr spooler by executing 'lpd' to make sure it rereads the new printcap (although the rpm does that anyway). Enjoy.
                                Jack

howarth@nitro.med.uc.edu
Thanks to Monroe Williams, we now have v0.9.5 of the lpstyl printer driver which when coupled with ghostscript turns the Stylewriter family of printers into 360 dpi postscript inkjets.
To set up your Stylewriter you will first need the following packages...

lpstyl-0.9.5.ppc.tar.gz from ftp://ftp.sunet.se/pub/os/Linux/mklinux/mkarchive/sys/printing/

lpr-0.18-1.ppc.rpm from ftp://ftp.sunet.se/pub/os/Linux/mklinux/mkarchive/sys/printing/

ghostscript-4.0.3-2a.ppc.rpm and ghostscript-fonts-4.0.3-2a.ppc.rpm from ftp://ftp.sunet.se/pub/os/Linux/mklinux/mkarchive/publishing

enscript-1.4.2.ppc.tar.gz from ftp://ftp.sunet.se/pub/os/Linux/mklinux/mkarchive/publishing

To install the programs..

 1) Execute "tar -zxvf lpstyl-0.9.5.ppc.tar.gz" and then
    "tar -zxvf enscript-1.4.2.ppc.tar.gz"
 2) From inside the "enscript-1.4.2" directory do a 'make install'
 3| Now install lpr and ghostscript with by executing
    "rpm -i --force lpr-0.13-1.ppc.rpm", "rpm -i --force
ghostscript-4.0.3-2a.ppc.rpm"
    and "rpm -i --force ghostscript-fonts-4.0.3-2a.ppc.rpm"
 4) From the "lpstyl-0.9.5" distribution directory execute...
    "mkdir /usr/local/sbin" and "cp lpstyl /usr/local/sbin"
 5) Now do a "cd scripts" from inside the "lpstyl-0.9.5" distribution directory
    and execute "cp * /usr/local/sbin" to copy all the scripts.
 6) Go back up to the "lpstyl-0.9.5" distribution directory and 
    execute "mv /etc/printcap /etc/printcap.bak" and "cp printcap /etc" 
    to install the preconfigured printcap file.
 7) make a symbolic link to /dev/cua0 by executing
    "ln -s /dev/cua0 /dev/stylewriter"
 8) kick lpd to reread the new printcap file by executing "lpd"

At this point, providing you have a Stylewriter printer attached to the Powermac serial port, the default lpr printer is the Stylewriter. This configuration works by passing any print job to lpr through enscript. If the print job is only text, enscript creates the appropriate postscript code to print. If the print job is already postscript then it passes through enscript unchanged. The output of enscript is piped to ghostscript which rasters the postscript code into pbmraw files of 360 dpi resolution. These pbmraw files are in turn piped into lpstyl which manages sending these to the Stylewriter printer for printing.

A few minor notes: Make sure you are using the latest Mklinux DR2 Linux 2.0 kernel. At least one of the beta Linux 2.0 kernels had problems with the serial port which prevented lpstyl from handshaking properly. Also, although lpstyl attempts to allow you to continue printing when the printer runs out of paper and is refilled, this code doesn't work on some models of Stylewriter.

When printing certain postscript files (such as those that come with the Ghostscript distribution for example golfer.ps), you may notice cropping of the printed image. This occurs when the postscript file is missing the page layout information and can be avoided by executing lpstyl with a '-m' argument. Most programs programs like nedit, Mosaic, etc. do provide the necessary formatting information and will not exhibit the cropping problem.

The current version of lpstyl runs on the original Stylewriter, Stylewriter II, Stylewriter 1200 and Color Stylewriter 2400. It may run on other models as well. If you have problems printing to any other model of Stylewriter please e-mail Monroe Williams at monroe@pobox.com and let him know what oddities you are seeing.

                 Jack Howarth
                 howarth@nitro.med.uc.edu

Note: As of the last set of kernel update in Feb 97, the required serial port support is broken again. Apple claims that the serial support just happened to work previously. It is unclear if this will be fixed and when.

--- notes for install on linux-pmac:

 For step (7), use /dev/cua1 rather than /dev/cua0.
 I had to 'mkdir /var/spool/stylps' on my system as well.
                           - wj@acpub.duke.edu  5/9/97

monroe@pobox.com, howarth@nitro.med.uc.edu, wj@acpub.duke.edu, jonh@cs.dartmouth.edu
MkLinux DR2.1 update 6 appears to fix the serial port.  Using this and lpr 0.18
I've been able to print both ascii and postscript to my Stylewriter 1200 from my
6100 machine.  If you have trouble, make sure the directory /var/spool/stylps
really exists.  The ascii command is lpr, but for postscript you need to use
lpr -Pstylps.
tom@bluesky.org
Yes, lpstyl appears to work extremely well under DR2.1Update6.
The only bug I can see in lpstyl now is the fact that when the
printer runs out of paper it aborts the print job rather than
waiting for the paper to be refilled. That is a known bug
for the Stylewriter II which hopefully Monroe will eventually
fix.
howarth@nitro.med.uc.edu
Can't print with StyleWriter after installing via Valentines Release of LinuxPPC?

The problem comes from not having a program called enscript installed.  Get the
archive from mkarchive and install it.  Then edit the /usr/local/sbin/stylascii
file to point to where enscript was installed.
jahlove@snip.net
I haven't had success in using lpstyl with my StyleWriter Portable,
so I tried other tricks...

The StyleWriter Portable is actually a serial Canon BJ-10e[x?],
so it's reasonably easy to use it with Linux:

- Install the printtool rpm (and dependencies if needed) and run it,
  (note that you don't need lpstyl)
- Add a new printer, select "Local printer",
- You'll need to specify a printer device; I'm using
  /dev/ttyS1, which is the printer port on my 7200 running LinuxPPC.
- Then "Select" an Input Filter
  - Printer Type: Canon BJ-10e
  - Resolution: as you like. 360x360 is quite clean 
    and fast enough for me.
  - Check "Send EOF..." and "Fix start-stepping text"
  - You can experiment with multipage text printing if 
    you like with the next two options. The printer 
    works well as a plain ASCII printer too.
  - I had to "shorten" GhostScript's idea of A4 paper
    to keep my prints on a single sheet... if you are
    using A4 paper at 360dpi, try -dDEVICEHEIGHT=4140
    in the extra parameters; otherwise check GS's doc.
- Now the printer queue is ready, but the serial port 
  is not. I'm using the following stty configuration
  to print on /dev/ttyS1:
    # stty -a < /dev/ttyS1
    speed 57600 baud; rows 0; columns 0; line = 0;
    intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
    eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
    lnext = ^V; flush = ^U; min = 1; time = 0;
    -parenb -parodd cs8 -hupcl cstopb cread clocal crtscts
    -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon -ixoff
    -iuclc -ixany -imaxbel
    -opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
    ff0
    -isig -icanon -iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
    echoctl echoke
  which I set with
    stty 200:2:80008f10:47:3:1c:7f:15:4:1:0:0:0:0:17:12:1a:11:13:16:15:0:0 < /dev/ttyS1
  and 
    setserial /dev/ttyS1 closing_wait 6000
    setserial /dev/ttyS1 UART 8250
  to prevent corruption.
  
  To make all this automatic, create a file: /etc/rc.d/rc.serial, containing:
    #!/bin/sh
    stty 200:2:80008f10:47:3:1c:7f:15:4:1:0:0:0:0:17:12:1a:11:13:16:15:0:0 < /dev/ttyS1
    setserial /dev/ttyS1 closing_wait 6000
    setserial -av /dev/ttyS1 UART 8250
  (remember to make it executable!)

Now you should be able to print both ASCII and PostScript with lpr.
colin.cholley@mail.dotcom.fr
If you get the message "Spooling is disabled" when trying to run lpr as an ordinary user, have a look in the /var/spool/stylps directory. I found a lock file in there and it turns out if the group execute bit is set on that lockfile then lpr will disable spooling. This is not mentioned in the manpage. I only found this out from the source. So to fix it do "chmod g-x lock"
b.judd@xtra.co.nz
[Append to This Answer]
Next: (Answer) How do I fix garbled printer output?
This document is: http://www.jonh.net/cgi-bin/lppcfom/fom?file=49
[Search] [Appearance]
This is a Faq-O-Matic 2.717d.
Hosted by anduin.org and SourceForge Logo