[ale] Printing problems
Mike Nelson
mnelson at bellsouth.net
Sun Jun 7 21:45:51 EDT 1998
I'm using Debian, here's my simplest printcap and filters for my HP Deskjet 600:
printcap:
-----------------------------------------------------------------
## /etc/printcap: printer capability database. See printcap(5).
## You can use the filter entries df, tf, cf, gf etc. for
## your own filters. See /etc/filter.ps, /etc/filter.pcl and
## the printcap(5) manual page for further details.
## Do not use tabs
## /dev/lp1 for Linux 2.0 series
## /dev/lp0 for linux 2.1 series
#
#
lp|Generic dot-matrix printer entry:\
:lp=/dev/lp1:\
:sd=/var/spool/lpd/lp:\
:if=/etc/lpf:\
:df=/etc/filter.ps:\
:af=/var/log/lp-acct:\
:lf=/var/log/lp-errs:\
:sh:
-----------------------------------------------------------------
This printcap says:
lp = print to device lp1 (because it's a 2.0.x kernel)
sd = spool directory
if = the default filter is /etc/lpf2
df = this is the filter I use to call Ghostscript
af/lf = logging stuff that's always empty on my system, dunno why
here's my homemade filter, lpf:
--------------------------------------------------------------
#!/bin/sh
echo -ne \\033\E
echo -ne \\033\&k2G
echo -ne \\033\&l0E
echo -ne \\033\&l66F
cat
echo -ne \\014
---------------------------------------------------------------
the &k2G tells the HP to do a CR+LF when it sees a CR
here's another filter for 20 cpi printing /etc/lpf2:
The commented lines are the HP PCL codes for you to tamper with.
HP's web site has the complete set of pcl codes
-----------------------------------------------------------
#!/bin/sh
echo -ne \\033\E
echo -ne \\033\&k2G
echo -ne \\033\&s0C
echo -ne \\033\&l10O
echo -ne \\033\(s20H
echo -ne \\033\(s6V
echo -ne \\033\(s3T
echo -ne \\033\&l12D
echo -ne \\033\&l4.00C
echo -ne \\033\&k6.00H
echo -ne \\033\&a10l
echo -ne \\033\&a155M
echo -ne \\033\&l2E
echo -ne \\033\&l122F
cat
echo -ne \\014
#E reset
#&k2G set CR -> CR+LF
#&s0C line wrap
#&l0O page orientation
#(0U character set ansi
#(s0P proportional spacing
#(s20H horizontal density
#(s6V character height
#(s0S typeface norm,italic
#(s3T font courier
#(s1Q quality, 2 for nlq
#&l2A paper size usletter
#&l0L skip perforation
#&l12D vertical spacing 12 lpi
#&l4.00C vertical spacing 48/x =lpi
#&k6.00H horizontal spacing
#&a0L left margin at 0 spaces from left
#&a160M right margin at 160 spaces from left
#&l0E top margin at 0 lines from top
#&l125F bottom margin at 125 lines from top
#&k6W text scale mode
#(s0B line thickness normal
--------------------------------------------------------------
If you want to do cat file > /dev/lp1 , run the filter on it first
to insert the control codes at the beginning of the file.
/etc/lpf < file.in > file.out
cat file > /dev/lp1 is supposed to give staircase print on an HP DJ500
because HP expects a carriage return to do a carriage return and a line
feed to do a line feed. This is the one time where MS-DOS is right and
the rest of the world is wrong.
I get the exact same messages from lpc if I have zero jobs queued.
If I turn my printer off and lpr file, then lpq shows one job waiting.
lpc> status lp
queuing is enabled
printing is enabled
1 entry in spool area
lp is ready and printing (this line is /var/spool/lpd/lp/status)
It sounds to me as if you're not getting files spooled if you show no entries.
Turn your printer off before testing lpr printing so you can see.
When you say it goes in the queue, do you mean lpq shows entries, or
do you mean the directory in printcap shows the control and data spool files
named something like cfA0273Aa00329 and dfA0273Aa00329?
(sd=/var/spool/lpd/lp in my case, probably sd=/var/spool/lpd/dj in your case)
(lpq would show job 273 for these)
You can delete all the files in the spool directory in case one is hung.
from /var/spool/lpd do a ls -R to see if anything is getting spooled.
You can kill all the lpd's and then fire one off with lpc after you get
something spooled.
-------------Original message follows----------------------
I just switched from slackware to debian, because I wanted a little easier
upgrade path w/o having to use a gui for all the configs (I hate using X
if I dont have to, but I digress =)
Anyway, I originally installed LPRng for the print daemon, read the howtos
but they only covered lpd, so I uninstalled LPRng and installed lpd, since
the only things I print are directions/notes etc. and I dont need anything
special. Well I read the howtos, and I set my printcap up exactly how the
printcap in the howto is setup because Im using a deskjet 500 which is
what they use in the howto. Well, I set up the printcap and filter, and
when I cat file > /dev/lp1 it prints 2 staircased lines then hangs, when I
do lpr file, it puts it in queue but never prints. Heres a dump from lpc
Panic:~# lpc
lpc> status dj
dj:
queuing is enabled
printing is enabled
no entries
no daemon present
lpc> start dj
dj:
printing enabled
daemon started
lpc> status dj
dj:
queuing is enabled
printing is enabled
no entries
no daemon present
lpc>
For some reason it says there is no daemon running, but when I do pidof
lpd it shows it running. I get the same results use lp instead of dj.
Ive tried killing kerneld on the thought maybe kerneld was unloading it
immediately after it loads but no luck.
Im running kernel 2.0.34, anyone have any ideas? Im stumped
Nick
-----------------------------------------------------------
----------------------------------
E-Mail: Mike Nelson <mnelson at bellsouth.net>
Date: 07-Jun-98
Time: 19:44:09
This message was sent by XFMail
----------------------------------
More information about the Ale
mailing list