Author: Phillip Deackes
Email address: gsmh@bigfoot.com
One-line summary of topic\question:

How can I use my Epson Stylus or HP Deskjet printer with Red Hat Linux?

The Red Hat printtools and printfilters packages support both of these
printers as well as many others. Unfortunately the Ghostscript package
which comes with the Red Hat distribution does not contain the Epson
stcolor driver and has only basic support fo r the HP Deskjets. 

One solution is to get hold of the source files for Ghostscript and
compile in whichever drivers you need. There is a much easier solution,
however. 

SuSE Linux, a popular German distribution, uses RPM as its package
manager. The version of Ghostscript it uses has been compiled with more
drivers than the Red Hat version, and includes both stcolor and hpdj
support. 

The stcolor driver is essential to get decent quality from Ghostscript,
the hpdj driver follows the HP Windows driver model more closely than the
default Ghostscript driver. With hpdj you can use such options as
'MediaType', 'PrintQuality', 'Resolution' e tc. to tailor your printing to
your requirements. More on that later. 

The SuSE version of Ghostscript comes in the form of a lib package and an
X11 package, both of which need to be installed as a minimum to print in
X. The packages are currently called: 

gs_lib-5.10-0.i386.rpm and gs_x11-5.10-0.i386.rpm

They are available from:

ftp://ftp.suse.com/pub/SuSE-Linux/5.1/full-names/i386/

To replace your Red Hat ghostscript rpm package with the SuSE version you
need to: 

rpm -e --nodeps ghostscript  (to remove the current package)

rpm -ivh gs_lib-5.10-0.i386.rpm gs_x11-5.10-0.i386.rpm (to install the new
versions) 

If you are using the Red Hat printtool and printfilters package you will
now see the Epson Stylus option when you go to add a printer. 

To improve your printing with the Epson of HP printers I would suggest you
install MagicFilter and edit one of the Magic-filters to provide you with
more flexibility. 

The Magic Filter package comes as a tar.gz package magicfilter-1.2.tar.gz
and is obtainable from http://sunsite.unc.edu/pub/Linux/system/printing/

Follow the instructions to compile the package and make install. You then
need to setup your /etc/printcap file to point to the filters you wish to
use. The filters are compiled, but not automatically installed. They are
in the filters sub-directory of wh erever you unpacked the source. Copy
one of the filters to /usr/local/bin and open it in a text editor. There
are two lines near the top which contain the gs commands. You can safely
edit these lines to suit your printer. I started with the dj550c-filter
and replaced the lines with: 

 filter /usr/bin/gs -q -dNOPAUSE -sDEVICE=hpdj -sColorMode=CMYK -r600
-sPrintQuality=1 -sMediaType=plain -sModel=unspec -sOutputFile=- -

Note that all of the above is on one line. Save the edited filter to a
suitable name which you will refer to in your /etc/printcap. Repeat for
how ever many filters you need. 

To find the best options for your printer, refer to:

http://www.pe.net/~williams/Stylus/Stylus.html for Epson Stylus info

ftp://ftp.pdb.sni.de/pub/utilities/misc/hpdj.html for HP Deskjet info. You
will find hpdj docs on your system if you have installed the SuSE gs
package, in: /usr/share/ghostscript/5.10/doc/hpdj

On my system I have modified the filters so that I have five filters -
normal, presentation, draft, bond and glossy. My /etc/printcap is setup
like this: 

normal|lp:\
	:lp=/dev/lp1:\
	:sd=/var/spool/lpd/normal:\
	:sh:\
	:mx#0:\
	:if=/usr/local/bin/dj550c.normal-filter:

presentation|lp0:\
	:lp=/dev/lp1:\
	:sd=/var/spool/lpd/presentation:\
	:sh:\
	:mx#0:\
	:if=/usr/local/bin/dj550c.presentation-filter:

draft|lp1:\
	:lp=/dev/lp1:\
	:sd=/var/spool/lpd/draft:\
	:sh:\
	:mx#0:\
	:if=/usr/local/bin/dj550c.draft-filter:

bond|lp2:\
	:lp=/dev/lp1:\
	:sd=/var/spool/lpd/bond:\
	:sh:\
	:mx#0:\
	:if=/usr/local/bin/dj550c.bond-filter:

glossy|lp3:\
	:lp=/dev/lp1:\
	:sd=/var/spool/lpd/glossy:\
	:sh:\
	:mx#0:\
	:if=/usr/local/bin/dj550c.glossy-filter:

When I go to print from an application such as Applix, I can choose
normal, draft etc. depending on the print quality I require. Other apps
may need lpr -Pnormal and so on. 

The only thing to do now is to create the appropriate spool directories in
/var/spool/lpd - just create a directory for each of your filters. Use the
first name you have used in /etc/printcap for each filter. I have
/var/spool/lpd/normal, /var/spool/lpd/d raft etc.. 

Remember to restart lpd for the changes to take effect. Note that the Red
Hat printtool in control-panel will complain about the format of your
/etc/printcap, but just ignore the warning. 
