Setting up a non-postscript printer on a Debian PC using Magicfilter

Chris Lale

          chrislale@users.sourceforge.net
        

Revision History
Revision 1.014th November 2002Revised by: CTL
Initial draft

Table of Contents
1. About this article
1.1. Copyright information
1.2. Latest version
1.3. Bugs, errors and mistakes
1.4. Spelling, punctuation and grammar
1.5. Conventions used in this document
2. Introduction
2.1. What's the problem?
2.2. What's the solution?
2.3. Don't panic!
2.4. System requirements
2.5. Overview of the process
3. Preparation
3.1. Information about your printer
3.2. Choosing an input filter
4. Installing the software
4.1. Login as normal user or root user?
4.2. Install kernel modules for parallel port
4.3. Install Lpr for offline printing
4.4. Install Ghostscript - the PostScript interpreter
4.5. Install Magicfilter
5. Configure Magicfilter using Magicfilterconfig
5.1. Basic configuration
5.2. Fine tune the configuration
5.3. Install the new printcap file
5.4. Test your new configuration

1. About this article


2. Introduction


3. Preparation

Before you start, you need some information about your printer. This enables you to find a suitable Ghostscript driver and Magicfilter input filter for your printer. This is what you need:


3.2. Choosing an input filter

You need to know the name of a suitable Magicfilter input filter for your printer. You can find out which filters are available on your system later on from within Magicfilter. I have reproduced this list in Table 1 below.

Magicfilter's input filters make use of Ghostscript's printer drivers. The filters usually have names very similar to Ghostscript's drivers. For example, the 'epsonlq' filter makes use of Ghostscript's 'lq850' driver. You should be able to recognise the filter you need if you know the Ghostscript driver for your printer. You can find out which Ghostscript driver suits your printer from 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 Ghostscript driver for my Canon BJC-4200 printer was the 'bjc600'. This enabled me to choose Magicfilter's 'bj600' filter.

Here is the list that appears when you configure Magicfilter. The filters concentrate on the printer language. If you know, that your printer uses a given printer language (e.g. ESC/P2 or PCL5) and your printer is not listed, you can use another filter which uses same language.

You are now ready to install the software packages.


4. Installing the software

This section explains how to install kernel modules for parallel port printer support, the print spooler Lpr, the print filter Magicfilter and the PostScript interpreter Ghostscript.


4.2. Install kernel modules for parallel port

Skip this section if your printer does not connect to your parallel port. (The parallel port is a D-shaped connector with 25 pins in two rows. It is sometimes labelled 'LPT1'.)

The kernel may already have parallel printer support support module installed. You can check by running the modconf program by entering modconf at the command line. Modconf can also install the module for you.

The first screen asks you to select the category of modules. Scroll down the list (or tap m) to highlight 'misc Drivers that don't fit in the other categories'.

The next screen allows you to select modules. Scroll down the list (or tap l a few times) to highlight 'lp Parallel printer support'. If line is tagged with '+', the module is already installed. There is no need to install any more modules. Scroll up to the top of the list (or tap the home key) to return to the previous menu and exit.

If the 'lp' line is tagged with '-', you must install the module. Make sure that the line is highlighted and tap enter to install the module in the kernel. You should not need to enter commandline arguments. The 'lp' module is able to autoprobe for the information it requires.

Check that the 'lp' module is now tagged with '+'. Exit to the previous screen, and then exit the program.

# modconf

Please select the category of modules
misc     Drivers that don't fit in the other categories. enter

lp     - Parallel printer support enter
Install this module in the kernel? enter
Enter Command-Line Arguments (leave blank) enter

lp     + Parallel printer support
home

Exit     Finished return to previous menu enter

Exit     Finished return to previous menu enter

#
	  

4.5. Install Magicfilter

Use Apt-get to install Ghostscript and Magicfilter. Apt-get will also intelligently install any other packages that may be required. After unpacking and setting up Magicfilter it will suggest that you run Magicfilterconfig. More on this in the next section.

# apt-get install magicfilter

Reading Package Lists...
Building Dependency Tree...

The following NEW packages will be installed:
  magicfilter 

Media Change: Please insert the disc labeled '...Official i386 Binary-1...' enter

Unpacking magicfilter ...
Setting up magicfilter ...
Run `magicfilterconfig' if you want to have your printcap automatically
generated or edit it by hand.

#
	  

You are now ready to configure Magicfilter.


5. Configure Magicfilter using Magicfilterconfig

5.1. Basic configuration

Lpr uses a printer capabilities database file called /etc/printcap to store details about your printer's configuration. Magicfilterconfig needs to change some of the information in this file. Rather than making changes automatically, magicfilterconfig creates a new printcap file which you can use to replace the original one by hand. This leaves you in full control. You can always restore the original printcap file if the new one causes problems.

Magicfilterconfig asks you to provide a name for your printer and a short name for its spool directory. These can be anything you like, but you should try and make them recognisable. (I decided on 'Canon BJC-4200' for my printer's name and 'myCanon' for the spool directory.) Magicfilterconfig will also ask you for the device name of your printer port. This would be /dev/lp0 for a printer plugged into the lp0 (LPT1) parallel port. For a serial printer /dev/tty0 is the device for the tty0 (COM1) port, and /dev/tty1 for the tty1 (COM2) port.

You must also supply the name of the Magicfilter input filter that you chose in "Choosing an input filter" above. You can check that the input filter suits your printer by reading the first few lines of the filter file with a text editor. The files are in the /etc/magicfilter directory.

Magicfilterconfig prompts you to enter the full name for a second printer. Enter 'none' if you do not wish to set up a second printer.

# magicfilterconfig

Printer #1:
------------
  Full name, `done' when done                   [HP Laserjet 4L ]: Canon BJC-4200 enter
  Short name, name of the spool directory       [hplj4l         ]: myCanon enter
  Full device path (or remote machine name)     [/dev/lp1       ]: /dev/lp0 enter

(List of filters appears here.)

  The input filter to be used                   [ljet4l         ]: bj600 enter

Printer #2:
------------
  Full name, `done' when done                   [done           ]: done enter

Magicfilterconfig now summarises the settings you have chosen, and asks you to confirm them:

                       Printer configuration

Printer name  Short name Spool dir            Device     Input filter
-------------------------------------------------------------------------------
Canon BJC-420 myCanon    /var/spool/lpd/myCan /dev/lp0   bj600              *

	  Is this ok? (y/n) [y]: y enter

Some messages appear here. They are summarised in the next two sections.

Press  <ENTER> to continue. enter

#

Your new printcap file has been created in /var/tmp.