Canon 850/860 BubbleJet Printers on CUPS

Download the CUPS print drivers from the Canon Web site. We found them at:

     ftp://download.canon.jp/pub/driver/bj/linux/

The instructions and readme files are all in Japanese. But, the source is written in English. So, press on. Get the CUPS drivers, a tarball that looks something like:

     bjcups-2.4-0.tar.gz

You may also want to get the CUPS monitor and the print filter but they aren't necessary. If you do, get the tarballs that look something like:

     bjcupsmon-2.4-1.tar.gz
     bjfilter-2.4-0.tar.gz

To install the CUPS printer driver, untar the tarball:

     tar -xvzf bjcups-2.4-0.tar.gz

Forget the directions. First build the libraries as follows:

     cd bjcups-2.4-0/libs
     make

Now move on to the CUPS print filter. Our copy of the source had a couple of bugs in it so you'll want to fix them up, if they're still there. Hack pstocanonbj.c in the filter directory and make the following changes:

     350,351c351,353
     <                       p_choice = ppdFindMarkedChoice(p_ppd, "Resolution");
     <                       reso = atoi(p_choice->choice);
     ---
     >                       if ((p_choice = ppdFindMarkedChoice(p_ppd, \
                                 "Resolution")) != NULL)
     >                               reso = atoi(p_choice->choice);
     >                       else reso = 360;
     354,355c356,358
     <                       p_choice = ppdFindMarkedChoice(p_ppd, "PageSize");
     <                       p_size = ppdPageSize(p_ppd, p_choice->choice);
     ---
     >                       if ((p_choice = ppdFindMarkedChoice(p_ppd, \
                                 "PageSize")) != NULL)
     >                               p_size = ppdPageSize(p_ppd, \
                                         p_choice->choice);
     >                       else p_size = ppdPageSize(p_ppd, "Letter");

Also, our version of GhostScript was not in a place that the CUPS scheduler could execute it from with its PATH variable set as it was (whatever it was, it didn't work). So, we found the GhostScript program (in our case /usr/local/bin/gs) and added/changed the following lines in pstocanonbj.c:

     42a43
     > #define GS_PATH                       "/usr/local/bin/gs"
     365,366c368,369
     <       "gs -r%d -g%dx%d -q -dNOPROMPT -dSAFER -sDEVICE=ppmraw \
                 -sOutputFile=- -| ",
     <       reso, (int)(p_size->width * (float)reso / 72.0),
     ---
     >       "%s -r%d -g%dx%d -q -dNOPROMPT -dSAFER -sDEVICE=ppmraw \
                 -sOutputFile=- -| ",
     >       GS_PATH, reso, (int)(p_size->width * (float)reso / 72.0),

Now, build the filter as follows:

     cd ../filter
     cc -c -O2 -Wall -I../libs/bjexec -I../libs/paramlist pstocanonbj.c
     cc -c -O2 -Wall canonopt.c
     cc -o pstocanonbj pstocanonbj.o canonopt.o -L../libs/bjexec \
        -L../libs/paramlist -lcups -lbjexec -lparamlist

Install the ppd and filter into your CUPS directories as super user:

     cd ..
     su
     cp filter/pstocanonbj /usr/lib/cups/filter
     chmod ugo+x /usr/lib/cups/filter/pstocanonbj
     cp ppd/*.ppd /usr/share/cups/model

Now, for the screwy part. The Canon kids messed up the distribution so that several libraries that are needed for all this stuff to work are not available in source form. "Sorry Charlie." You will have to get their RPM and install it. It contains the dynamic libraries that are used by the printer filter as well as bitmaps, fonts and other stuff needed by the printer. Download the RPM for the printer:

     bjfilterpixus860i-2.4-0.i386.rpm

To check what it will install before you let 'er rip, you can try:

     rpm -q -l -p bjfilterpixus860i-2.4-0.i386.rpm

To actually install the RPM, as super user, do the following:

     su
     rpm -i bjfilterpixus860i-2.4-0.i386.rpm

Note that the RPM wants old versions of libglade and libpng. If you have recent versions, it will fail on the dependency checks. To force it to install anyway, use:

     rpm -i --nodeps bjfilterpixus860i-2.4-0.i386.rpm

If you do force install the RPM, you may have to add some symlinks for some of the older libraries. To test if the symlinks are necessary, run the filter program and see if it complains about missing shared libraries (you'll have to do this iteratively, since the loader only tells you about one missing library each time the program is run). For example:

     /usr/local/bin/bjfilterpixus860i

If you need to add symlinks, they'll probably look something like this (take a look at the other symlinks in /usr/lib that point to the current versions of the shared libraries and see where they point). Only add the ones you actually need:

     cd /usr/lib
     ln -s libpng.so.3.49.0 libpng.so.2
     ln -s libglade-2.0.so.0.0.7 libglade.so.0

Once all of the above is done, you should be able to define a new printer on your system using the Canon 860i. Launch the CUPS UI via your Web browser:

     http://printserver:631

Configure the "Canon" printer using the Administration tab and Add Printer button. Choose the following:

     Other Network Printers: LPD/LPR Host or Printer
     Connection: lpd://kinkos/Photo
     Name: Photo
     Description: Color, Canon i860 photo printer
     Location: Office
     Sharing: Share This Printer (checked)
     Make: Canon
     Model: Canon PIXUS 860i ver.2.4 (en)

Click the Continue button as necessary. At the end, click Add Printer.

Next, set the following options under each of the tabs shown:

General
Paper Size: Letter Media Type: Plain Paper
Banners
Starting Banner: none Ending Banner: none
Policies
Error Policy: stop-printer Operation Policy: default

When done, click on the Set Default Options button.

Now, from the lefthand menu, pick Print Test Page. You should see a nice test page printed on the Photo printer. If that doesn't work, let the debugging begin. The test page produces some heavy byte traffic to the printer so it should take a few minutes to print. If the print job ends immediately, you have probably screwed up the GhostScript path or the print filter itself. Check those things first. CUPS is pretty good at giving up silently, when an error occurs in those areas.

You can probably install any of the other Canon BubbleJet printers too, if you download the correct support RPM from their download site. Good luck. Note that if you are going to share this printer or one of its ilk with Winblows via Samba, it will not work. The postscript files created by the CUPS/Winduhs drivers are converted by GhostScript to something that the Canon filter chokes on. Best to set up a separate RAW printer under CUPS and share this with Windoze. You can then install the standard BubbleJet drivers on Windows and get on with your life.