lexmark z53 printer
Joel Hammer
Joel
Mon May 17 11:42:31 PDT 2004
No problem. I generated the configuration file with the lexmarkz53 program,
renamed it z53Photo.conf, and then edited the filter file to use that configuration file
only, and renamed it z53Photo.sh
First, the filter:
#!/bin/sh
DEBUG=0
PDIR=/usr/local/lexmark/z53
TMPFILE=`mktemp /tmp/lexmark.XXXXXX`
# lxgps is a little utility used to setup the
# Ghostscript parameters. It sets two parameters
# in particular: resolution and paper size. It
# determines what to set these to by reading the
# configuration file that is passed in.
GSPARMS=`$PDIR/lxacgsparm z53.conf`
echo $GSPARMS > parms
set > shellvalues
echo Have run this script >> shellvalues
runz53 ()
{
cat > $TMPFILE
file -b $TMPFILE | grep -i postscript > /dev/null
if [ $? -eq 0 ] ; then
gs -q -dNOPAUSE $GSPARMS -sDEVICE=ppmraw -sOutputFile=- $TMPFILE | $PDIR/z53 --config z53Photo.conf --dotcounts
else
file -b $TMPFILE | grep -i PDF > /dev/null
if [ $? -eq 0 ] ; then
gs -q -dNOPAUSE $GSPARMS -sDEVICE=ppmraw -sOutputFile=- $TMPFILE | $PDIR/z53 --config z53Photo.conf --dotcounts
else
enscript -B -o - $TMPFILE | gs -q -dNOPAUSE $GSPARMS
-sDEVICE=ppmraw -sOutputFile=- - | $PDIR/z53 --output blackonly --config z53Photo.conf --dotcounts
fi
fi
/bin/rm -f $TMPFILE
}
runz53 2> /dev/null
The only change was in the --config parameter given to the lexmark provided
driver, z53.
Now, it is not obvious, but lexmarkz53, and the lxacgsparm program in
the filter above assume /var/spool/lexmark is the directory to store the
configuration files. (I find these things out by using locate and
strings binaryprogram | grep spool, and so on.)
So, you don't need to provide the full pathname for the configuration file
in the --config option, just the name of the file.
Here is my z53Photo.conf:
[settings]
queue=z53-outfiles
resolution=2400
blackonly=no
mediasize=letter
quality=business
paper=glossy
cartridge=black
[outfiles]
align=/usr/local/lexmark/z53/lxacalgn.out
clean=/usr/local/lexmark/z53/lxaucln.out
photoalign=/usr/local/lexmark/z53/lxacphal.out
photoclean=/usr/local/lexmark/z53/lxauphcl.out
testpage=/usr/local/lexmark/z53/lxactstc.out
[black]
a=25
b=7
c=10
d=15
e=13
f=13
[photo]
a=15
b=8
c=15
d=15
[dotcounts]
cyan=205244387
magenta=203060491
yellow=226198509
black=321406435
dilutedcyan=0
dilutedmagenta=0
[oldblack]
black=0
blackindex=0
[oldkcm]
black=0
dilutedcyan=0
dilutedmagenta=0
photoindex=0
[oldcmy]
cyan=0
magenta=0
yellow=0
colorindex=0
=====End of z53Photo.conf
This editing of programs to use different configuration files is very handy.
It can also be done with binary files, with vi -b.
The only trick there is to use the exact same number of characters for the
new file name as the old file name. This is very handy. For example, for
a while my daughter ran two version of netscape, one which did and one which
did not use a proxy server. She never had to change any settings herself,
just start the right version of netscape (ie., click on the correct icon.)
Don't forget you have to add a printcap entry, with the right print filter
name, too.
Photo:\
sh:sd=/var/spool/lpd/z53Photo:mx#0:\
:lp=/dev/lp0:\
:if=/usr/local/lexmark/z53/z53Photo.sh
:mc#1
:sh:
Joel
On Wed, Jan 01, 2003 at 12:21:36PM -0700, Collins wrote:
> On Wed, 1 Jan 2003 01:21:03 -0500
> Joel Hammer <Joel at hammershome.com> wrote:
>
> > The z53Photo.sh is one I wrote myself. You won't have it. It is just
> > z53.sh which uses a different configuration file, one that is
> > configured for glossy photo printing.
> >
>
> Joel,
>
> Would you have any problem with posting your Z53Photo.sh and
> configuration file to the group? I, for one, would like to try it out.
More information about the Linux-users
mailing list