chrislale@users.sourceforge.org
Revision History | ||
---|---|---|
Revision 1.2 | 12th February 2002 | Revised by: CTL |
Removed use of dselect and added use of apt-get instead. Tidied up formatted layout of the XML document. | ||
Revision 1.1 | 26th February 2002 | Revised by: CTL |
Added abstract, completed "Configuring Apsfilter" and "Checklist". | ||
Revision 1.0 | 24th February 2002 | Revised by: CTL |
Initial release |
Copyright ©2002 Chris Lale (chrislale@users.sourceforge.org). Permission is granted to copy, distribute and/or modify this document with no Invariant Sections, with no Front-Cover texts and with no Back-Cover Texts under the terms of the GNU Free Documentation License, version 1.1 or any later version, published by the Free Software Foundation. A copy of the license can be found at http://www.fsf.org/copyleft/fdl.html
This document is written in English (not American English). If you spot a mistake, please check with a British dictionary or spell-checker before contacting me!
If you are reading this because your non-postscript printer is spewing out pages and pages of postscript code - don't panic. You can use the command lprm to remove the active print job. If you are using X-windows you must open a terminal first. You could use "xterm". If you want to use "GNOME terminal", activate the desktop menu and choose Gnome->Utilities->GNOME terminal
Gnome->Utilities->GNOME terminal |
If you just want to remove the active job, type lprm followed by enter. If you want to remove all pending print jobs, type lprm - followed by enter. (Don't forget the "-" switch.)
debian:~# lprm - enter |
You can find out more about this command by typing man lprm followed by enter at the command prompt.
This document assumes that you are running Debian Linux 2.2 (Potato) and the lpr spooling daemon. (This is the default setting, so if you haven't changed it, that's what you've got.) Everything you need can be found on the three Debian Official Binary cd-roms.
I have tested these instructions on my i386 system. I started with a fresh, clean, base installation of Debian 2.2 r4. I then installed The X Window System (core) and the Gnome desktop. You don't need to work within X, but you may wish to test the installation by printing from some X applications. My system has a Canon BJC-4200 colour inkjet printer attached to the parallel port. The following instructions reflect this.
Some programs seem to print OK to a non-postscript printer. When I first installed Debian I tried printing a text file from Emacs. It printed perfectly and I thought everything was OK. Then I tried Emacs' "Pretty-Print" and the printer produced an unending stream of pages covered with nonsense. Switching the printer on and off, and even re-booting the PC, failed to stop the flow. This is when I found out about the lprm command.
The printing system expects Postscript files. Fortunately, Debian includes a software package called Apsfilter. Apsfilter converts your print file format before it reaches the printer. Apsfilter uses Ghostscript - a postscript emulator that is part of the Debian distribution.
I have assumed that you will prefer to carry out the installation in stages rather than in one go. It takes a little longer but you can test that everything works at each stage. This makes it easier to pin down errors, or even avoid them all together. I have tried to make each section in this article as self-contained as possible.
Look at the checklist at the end of this article for an outline of the stages.
Before you start, you should make a note of the details of your printer and a suitable printer driver. The following two sections explain what you need to know.
You will need to know the following information:
Make and model of your printer
The port used by your printer. Most printers are connected to the parallel port LPT1 (lp0 in Linux). If it is a serial printer, it is usually connected to COM1 (ttyS0) or COM2 (ttyS1).
You will need to find out the name of a suitable printer driver. You can find out which drivers are available on your system later on from within Apsfilter. You can also make a guess and use trial-and-error to find a driver that works. However, the hard work has already been done, and there is a Linux printer database on the web. You can find it at http://www.linuxprinting.org/printer_list.cgi. Using this database I found that the driver I needed for a BJC-4200 printer was the bjc600. You can also download printer drivers that may not be included in your distribution.
You are now ready to install the Apsfilter software.
This section explains how to install Apsfilter. The package is called "apsfilter".
You could login and stay in text mode, or you may prefer to use an X terminal window (eg xterm or GNOME terminal). Working in the X Window System makes testing easier.
Login as an ordinary user. The hostname of my PC is "debian". It has an ordinary user called "chris". My login screen looks like this:
Login: chris enter Password: ****** enter |
Start the X Window System.
chris@debian:~$ startx enter |
Open a terminal window such as "xterm". Activate the desktop menu and choose xterm.
xterm |
You need to have root priviledges to install Apsfilter. The "super-user" command, su, enables you to do this, and it is safer than actually logging in as root. The password is the root password.
chris@debian:~$ su enter Password: ****** enter |
apt-get is a simple command line interface for downloading, installing and removing packages. You will need the Debian 2.2 Official Binary CDs. They contain the packages (or .deb files). To install the apsfilter package, type apt-get install apsfilter and tap enter.
debian:/home/chris# apt-get install apsfilter enter |
apt-get will give you a list of package to be installed. If you have not already installed Ghostscript, one of them will be "gs". You will also be asked to insert the appropriate CD-ROM disc(s).
Media Change: Please insert the disc ... in the drive '/cdrom/' and press enter enter |
apt-get will unpack some files onto your hard drive. You may be asked to insert another cdrom.
Media Change: Please insert the disc ... in the drive '/cdrom/' and press enter enter |
apt-get will then ask you if you wish to configure Apsfilter by running "apsfilterconfig". I recommend not doing this yet, but completing the installation first. The next section deals with configuring Apsfilter.
Do you wish to run apsfilterconfig now? [yes/no] n enter |
Finally, remove any unwanted software.
debian:/home/chris# apt-get clean enter |
Apsfilter is now installed. You are now ready to configure Apsfilter.
This section assumes that you have installed Apsfilter, but not yet configured it. Alternatively, you may wish to reconfigure Apsfilter. You should still be logged in as a super-user (see "becoming a super user" in the previous section).
If your configuration goes irretrievably wrong, you can go back and re-install Apsfilter. Before you do this, you must remove the apsfilter package and its configuration using apt-get. This is called "purging" the package.
At the command prompt, type apt-get --purge remove apsfilter and tap enter.
debian:~# apt-get --purge remove apsfilter enter The following packages will be REMOVED: apsfilter* Do you want to continue? [Y/n] y enter |
Now reinstall apsfilter (see running apt-get install in the previous section).
At the command prompt, type apsfilterconfig and tap enter.
debian:/home/chris# apsfilterconfig enter |
Now work your way through the initial screens until you get to the Apsfilter setup main menu. As part of the licensing conditions, the author asks that you send him a postcard. You can e-mail the author during the setup process, but you may prefer to wait until the configuration is complete. (Send a message to <request-snailmail@klemm.gtn.com> for the postal address.)
ACCEPT LICENSE[Y|y|J|j|N|n]? y enter Request my snail mail address now [Y|y|N|n]? n enter [ Press <RETURN> to continue ] enter [ Press <RETURN> to continue ] enter A P S F I L T E R V 514 *** The Unix Print Solution *** [ Press <RETURN> to continue ] enter A P S F I L T E R S E T U P -- PROGRAM INFO -- [ Press <RETURN> to continue ] enter |
![]() | You cannot return to the main menu if you carry out this check |
---|---|
If you do not need to check that your driver is on the system, skip this and go on to the next section. If you procede, you will have to exit apsfilterconfig and re-start it. |
From the main menu, you can check that the driver you need is available. (To find out which driver you need, see the section on choosing a printer driver). Option (D) calls Ghostscript with the -h switch to find out which drivers are available in the Ghostscript binary file. (Ghostscript was installed as a dependency when you installed Apsfilter.) This gives you a list of drivers in no particular order. Tap space for the second page of the list. To continue, hold down ctrl and tap z, tap enter to restore the command prompt.
A P S F I L T E R S E T U P -- MAIN MENUE -- Your choice ? D enter space ctrl-z enter |
Run Apsfilter again (see previous section). (There may be a better way of returning to the main menu, but I have not found it.)
If you downloaded a driver from http://www.linuxprinting.org , then visit http://www.apsfilter.org for detailed help.
From the main menu, you can select your printer driver by choosing option 1. Tap 1 followed by enter.
A P S F I L T E R S E T U P -- MAIN MENUE -- Your choice ? 1 enter |
This brings you to the "Printer Driver Selection" menu. Choose a printer family that seems closest to your printer. For the Canon BJC-4200 I chose "2 - for Canon and Canon compatible printer". Tap a number followed by enter.
A P S F I L T E R S E T U P -- Printer Driver Selection --
Your choice ? (type menu item number) enter |
This gives you a list of printer drivers to choose from. If you have chosen the wrong list, just tap enter to return to the Printer Driver Selection menu. For the Canon BJC-4200 I chose "(3) bjc600". Tap a number followed by enter, then confirm your choice.
Please enter the printer driver of your choice or type <RETURN> to choose another catagory/driver:
Your choice ? (type menu item number) enter
Please confirm selection OK y/n ? y enter |
You should now be returned to the main menu.
From the main menu, you can set up your printer interface (parallel or serial) by choosing option 2. Tap 2 followed by enter.
A P S F I L T E R S E T U P -- MAIN MENUE -- Your choice ? 2 enter |
This brings you to the "Interface Setup" menu. I am assuming that you will want to set up a parallel printer, so choose option 1. (If you want to set up a serial printer, choose option 2.) Tap 1 followed by enter.
A P S F I L T E R S E T U P -- Interface Setup -- 1) Configure a parallel printer 2) Configure a serial printer Your choice ? 1 enter |
This brings you to the "Parallel Interface Settings" menu. You need to know which socket your printer is plugged into. Most PCs have one 25-pin parallel port (often labelled "Printer" or "LPT1"). The Linux path for this device is "/dev/lp0". You need to enter this path.
A P S F I L T E R S E T U P Parallel Interface Settings -- Device -- Full path of parallel print device: /dev/lp0 enter |
You should now be returned to the main menu.
This is it! Are you ready? All you need to do now is choose your paper size and try a test print.
![]() | Options (4) and (5) |
---|---|
Leave these set to [default]. There seems to be a bug that stops you from restoring [default] once you have chosen something else. If you experience this problem, you must purge Apsfilter from the system, re-install it and start again (see Don't panic! above ). |
To set your paper size, choose option 3 from the main menu.
A P S F I L T E R S E T U P -- MAIN MENUE -- Your choice ? 3 enter |
This brings you to the "Paper Format" menu. I have A4 sized paper in my tray, so I chose option 1 (DIN A4). If you use Letter, choose option 2.
A P S F I L T E R S E T U P -- Paper Format -- 1) DIN A4 2) Letter 3) DIN A3 Your choice ? 1 enter |
This returns you once again to the main menu. Now, make sure that you printer is plugged in and switched on. (It seems obvious, but is is surprising how many times this is the cause of a printing problem!) Enter T. Enter T again, confirm, and hold your breath.
A P S F I L T E R S E T U P -- MAIN MENUE -- Your choice ? T enter Creating the test output might last some time, please be patient. T) Print a test page *) Back to main menue Your choice ? T enter OK, to print test page ? [y/n] y enter Creating test page... Printing test page... [ press RETURN to continue ] enter |
I hope it worked for you. If not, you probably chose the wrong printer driver. Choose option 1 and try a different driver.
If all worked well, you should be looking at the main menu again (with a test print sheet in your hand). Choose C to continue printer setup.
A P S F I L T E R S E T U P -- MAIN MENUE -- Your choice ? C enter |
This takes you to the "Apsfilter installation" screen. If your printer is a colour printer you must enter c. If it is black-and-white you must enter m for monochrome. My printer is a colour printer.
A P S F I L T E R I N S T A L L A T I O N Is your printer a (c)olor printer or a (m)ono printer ? ? c enter |
You will now get confirmation that the file /etc/printcap has been created, and an invitation to read through various screens of news and information.
Finished creating/updating etc/printcap...
Now some important news/informations follow...
Please read them carefully !
[ press <RETURN> to continue ]
enter (repeat as often as necessary) |
Tap enter at the end of each screen until, finally, apsfilterconfig checks your system for available filters.
looking for available filter programs on this system... [ press <RETURN> to continue ] enter [ press <RETURN> to continue ] enter That's it... ...have fun !!! Andreas /// |
Try printing from your favourite applications as a super-user, and as an ordinary user. To return to being an ordinary user, enter exit at the command prompt.
debian:/home/chris# exit enter exit chris@debian:~$ |
If you have any problems, visit the web site: http://www.apsfilter.org. The web site also tells you how to do some smart printing: print previews, 2 or 4 pages to a sheet, fake duplexing and more. Remember to send Andreas a postcard. Send a message to <request-snailmail@klemm.gtn.com> for the address.
Check the make and model of your printer.
Check the port that your printer is attached to.
Make sure that the printer is attached and switched on.
Install the Apsfilter package and its dependencies (including Ghostscript).
Run apsfilterconfig.
Select a printer driver.
Configure the printer interface.
Print a test page.
Save the Apsfilter configuration.
Test printing from applications.