|
Linux Tips
I'm using Linux at home to develop my NURBS++ library and finish my PhD (hopefully). Sometimes, I get stuck on the easiest tasks. For instance, it took me a couple of months just to get printing working. When I manage to get something working with difficulty, I'll post it here. I'm pretty sure I'll need the knowledge on my next OS upgrade anyway.
Printing on a HP deskjet 5550
I have redhat 7.3 installed and here are the steps that I had to go through to get the printer to work.
- Get the hpijs driver and install it (I installed 1.3.1 with no problem). I followed all their steps, even the one inside the patch section. I'm not sure it helped, but I did it nonetheless.
- When you install ghostscript 7.05, notice a little detail that bit me.
# ln -s /usr/share/fonts/default/Type1 /usr/share/ghostscript/fonts
That little bit of information turns out to be important if you want
ghostscript to find your fonts.
- Now you are ready to try to print to the printer and see if it works. In the usage example of the hpijs pages they give instructions that would lead you to use "DESKJET 5550" as the device model. Do not use capital letters, use lower case letters, i.e."deskjet 5550". I don't know how/why I clued in on that little detail (a lot of trial and errors) but I eventually did. Anyway, to test your printer do something like
# cd /usr/share/ghostscript/7.05/examples
# gs -sDEVICE=ijs -sIjsServer=hpijs -dIjsUseOutputFD -sDeviceManufacturer="HEWLETT-PACKARD"
-sDeviceModel="deskjet 5550" -r300x300 -dNOPAUSE -dSAFER -sOutputFile="/dev/lp0" tiger.ps -c quit
If you are like me, you will find a couple of problems. The first one is that /dev/lp0 doesn't work, use /dev/usb/lp0 instead. On my system, /dev/usb/lp0 only works for root, so try again but this time do
# su -
# chmod 777 /dev/usb/lp0
# exit
# cd /usr/share/ghostscript/7.05/examples
# gs -sDEVICE=ijs -sIjsServer=hpijs -dIjsUseOutputFD -sDeviceManufacturer="HEWLETT-PACKARD"
-sDeviceModel="deskjet 5550" -r300x300 -dNOPAUSE -dSAFER -sOutputFile="/dev/usb/lp0" tiger.ps -c quit
You should see a nice tiger at that point coming out of your printer.
- The next step is to try to use lp to print something, turns out setting the default (lprn) is too difficult. Use cups instead.
- Thus, the real next step was to install cups. It turns out it's already installed in redhat 7.3 so that's pretty easy.
- I went to linuxprinting.org to get an updated cups driver for my deskjet 5550 printer. I followed their how-to and copied the file inside the /usr/share/cups/models directory.
- Start cups with
# su -
# service cups start
- Start your browser and go to your local cups admin page. Add a printer (it's pretty straight forward). Try a test page. That worked out of the box for me, so I was a happy dude.
Try printing using the lp command. It won't work. Redhat still thinks lprn is what you want to use. You got to inform your system of your preference and do something like
# su -
# /usr/sbin/alternatives --config print
Select cups from the menu that will appear.
Try to print again using lp. It works!
Well it doesn't truly work yet, you still can't print text only files. They have to be postscript or pdf. Once I figure out how to get a simple text file to print, I'll post the information here.
|