Printing Under Linux

Table of Contents:

  • Adding a printer to the lab machines
  • Printing a file saved on your account
  • Printing from various applications
  • Adding a printer to your laptop
  • Spooling using CUPS
  • Spooling using LPR
  • Printing from the ISG labs is free. Please do not abuse this service or we may have to start charging (we do keep logs). The ISG lab printer is an OKI B8300 . This is a postscript/PCL5/PCL6 printer with double sided capability.

    Adding a printer to the lab machines:

    You don't need to add a printer to the linux lab machines, all print jobs go straight to the server. If you're using your own laptop read this.

    Printing a file saved on your account:

    Click the xpp icon icon on your toolbar. If you don't have one, start up a terminal window and type xpp (you can also type kprinter if you'd rather use that. These instructions are for xpp but you should be able to figure it out). Click on the Browse... button and select the file you want to print. The Home button will take you to your home directory. Once you've selected the file, click OK then choose the printer OKI and click on the Options... button. If you want, change the Orientation (Portrait or Landscape), the Page Selection (blank prints the whole document), Duplex mode (Flip on short or long edge) and the Scaled down printing (number of pages per sheet). Click OK then Print. Just as easy as windows..

    Printing a file from various applications:

    The easiest way of doing this is setting each application to popup xpp for printing. Follow the same instructions as above for printing except for the Browsing part. You won't need to select a file to print, xpp will automatically receive whatever it is you're trying to print (the File(s) box in xpp will either be blank or contain the path for a temporary file). Here's* how to configure a number of popular applications. Note that most of them will remember the setting so you won't have to do this every time!

     

    1. Netscape: click on the Print icon enter xpp into the Print Command box then click on Print. This'll pop up xpp and you can select all the options you want. Netscape will remember to use xpp in future so you shouldn't have to enter it again.
    2. Ghostview (gv): click on State and select "Setup Options" from the menu. Disable the "Confirm Printing" and change the "Print Command" to read xpp. Click Apply then Save and finally Dismiss.
    3. Konqueror: click on Location, choose Print make sure the "Print system currently used" is set to Print through an external program (generic) and enter xpp in the box labeled "Print command". Click OK.
    4. OpenOffice: click the OpenOffice icon icon and select OpenOffice.org Printer Administration. Click the New Printer button, select Add a printer, click Next >>, select Generic Printer, click Next >> then enter xpp into the command box. Enter a name for the new printer (e.g. xpp) and select the "Use as default printer" then click Finish and Close.
    5. Mozilla: click the mozilla icon and select File then Print, make sure it's set to print to Printer (not File) then click Properties and enter xpp into the "Print Command" box. Click Ok.
    6. Evolution: select Print from the File menu. Make sure the Select printer is set to Generic Postscript and enter xpp into the Printer box. Click Print. The File(s) box in xpp will be blank. That's fine.
    7. KMail: Kmail's default printing interface is kprinter, a comparably user-friendly GUI to xpp. The only thing you need to look out for is the "Print System Currently Used" drop down menu which should be set to CUPS (Common Unix Print System) (not LPR/LPRng print system!). However, if you'd rather use xpp then make sure the "Print System Currently Used" is set to Print through an external program (generic) and enter xpp into the box labeled "Print Command" and click Print. You'll notice a file is automatically selected for you in the xpp File(s) box (Don't touch it! It's what you're trying to print) so you just need to select your settings.

    Adding a printer to your laptop:

    You can either print directly to the printer or configure your printing system to spool via our print server earth.isg.rhul.ac.uk. It's running a cups daemon (port 631) --the preferred way of doing printing here-- and a traditional lpd daemon (port 515) --for compatibility. If you'd rather do things the hard way and print directly to the printer, you'll need to know its ip address (192.168.203.81) and its make (OKI B8300). For the rest, you're on your own!

    Spooling via our print server using CUPS:

    This is the easiest setup. Simply edit /etc/cups/client.conf to contain nothing but the following line:
    ServerName earth.isg.rhul.ac.uk

    That's it. You don't need to have the cups daemon (cupsd) running so you can disable it using something like:
    chkconfig --level 345 cups off && /etc/init.d/cups stop. Cups comes with its own versions of lp, lpq, lpr, lprm, lpstat, and cancel in /usr/bin/ usually with a .cups extension (you'll probably also have the original commands --same names-- installed as part of LPR or LPRng). You might find it easier to symlink the lp commands to the cups ones (e.g. rm /usr/bin/lpr && ln -s /usr/bin/lpr.cups /usr/bin/lpr, etc. for the other commands.) since they are cups-aware in various ways.
    As all this is distribution-specific the cups/lpr binaries instructions might be a load of lies for your particular setup! (though it's true for Redhat 7.3) If you're really stuck ask us.

    Spooling via our print server using LPR:

    You should be able to get by with the following entry in /etc/printcap (taken from the Printing-HOWTO) --you'll now have the printer set up as both lp and oki.
    # remote printer oki on earth
    lp|oki:\
    :sd=/var/spool/lpd/oki:\
    :rm=earth.isg.rhul.ac.uk:\
    :rp=oki:\
    :sh:

    Note that there is still a spool directory on the local machine managed by lpd. If the remote machine is busy or offline, print jobs from the local machine wait in the spool area until they can be sent. You'll probably need the lpd daemon running (chkconfig --level 345 lpd on && /etc/init.d/lpd start).

    PPD Files

    Lab 255 Oki Printer

    Notes:
    * Some of the tips were shamelessly copied or adapted from http://www.mandrakeusr.org/docs/hardware/hcups8.html