|
|
How do I print to my Deskwriter? |
| First, set up /etc/printcap and /usr/local/bin/deskwriter-filter as follows:
| |
# /etc/printcap
#
# Please don't edit this file directly unless you know what you are doing!
# Be warned that the control-panel printtool requires a very strict format!
# Look at the printcap(5) man page for more info.
#
# This file can be edited with the printtool in the control-panel.
##PRINTTOOL3## LOCAL
lp|deskwriter:\
:sd=/var/spool/lpd/deskwriter:\
:mx#0:\
:sh:\
:sf:\
:lp=/dev/printerport:\
:lf=/var/log/lpd-errs:\
:if=/usr/local/bin/deskwriter-filter: | |
#!/bin/sh # /usr/local/bin/deskwriter-filter # pass through enscript to turn text into PostScript (PS should stay PS?), # then through ghostscript to rasterize, and out to the printer. /usr/local/bin/enscript -M Letterdj --pass-through --lineprinter -o - |\ /usr/bin/ghostscript -q -dNOPAUSE -sDEVICE=deskjet -sOutputFile=- - exit 0 | |
Then set up /dev/printerport. I call it that because /dev/printer gets recreated
on every boot as a named pipe. For MkLinux, use `cua0` instead of `cua1.`# (cd /dev; ln -s cua1 printerport)Make sure bin can talk to the printer (again, use the appropriate cua device). # chmod 660 /dev/cua1 # chgrp bin /dev/cua1Make the lpr spool directory and log file: # mkdir /var/spool/lpd/deskwriter # chgrp lp /var/spool/lpd/deskwriter # touch /var/log/lpd-errsThen append this to your /etc/rc.d/rc.local: # set up printer port parameters (-echo thanks toOh, and lest I forget, download the `enscript' package from MkArchive (in sys/printing/ps, last I looked), and install it. Just `tar xvzf enscript*; cd ensc...; make install' should do. That should do it. Reboot (to get the printer port permissions set up right), and try 'lpr' on a text or PostScript file. If it's not working, make sure that you can at least print a file by executing /usr/local/bin/deskwriter-filter < filenameas root. | |
| The enscript package is found on MkArchive
ftp://ftp.sunet.se/pub/os/Linux/mklinux/mkarchive/publishing/ps/ and not in the sys/printing/ps directory as stated above. | |
| MkLinux (pre-)DR3 uses /dev/cua1 as the printer port, so be sure that
/dev/printerport in the directions above points to cua1, NOT cua0. | |
|
On a Powerbook G3 the correct link for the modem/printer port is /dev/ttyS0
Replace all references to /dev/cua# above to this.
| |
| [Append to This Answer] | |
| jonh@cs.dartmouth.edu, mehul@ziplink.net, hollis@andrew.cmu.edu, graeme@surfinfo.com |
| Previous: |
|
| Next: |
|
| ||||||||