Xbubblejet

News Flash As of 30 May 1999, Xbubblejet is no longer being developed.

My Canon printer was broken when I moved to a new job/city. I have looked at all of the current printers and (unfortunately) consider the current Canon Bubblejets (BJC-5XXXX) to be inferior to similarly priced HP (882C) and Epson (Stylus 850) printers. I will still try to answer any questions from anyone who has them, but don't expect a new release. Anyone who wants to continue this project is more than welcome to!

  1. What is Xbubblejet?
  2. Why should I use it?
  3. What printers are supported?
  4. Where do I get it?
  5. What else do I need?
  6. How do I install it?
  7. How do I use it?
  8. PROBLEMS - what to do!
  9. Change Log
  10. TO-DO List
  11. Copyright Stuff
  12. About the Author

What is Xbubblejet?

Xbubblejet is a graphical user interface (GUI) program that runs under Xwindows that allows individual users on a UNIX system to set their own custom printer settings for the following items: bits per pixel, color/grayscale, lo/medium/hi print quality, DPI resolution, and paper type. It assumes that the user has a Canon BJC-XXXX series printer and is primarily using applications that generate postscript documents.

The Xbubblejet package provides two programs: xbubblejet, the interactive program run by the user, and canon-filter.pl, a print filter that determines if a file is a postscript file and, if so, calls the program ghostscript with the appropriate printing options specified by the user via xbubblejet.

Why should I use it?

First, it allows individual users to customize their own printer settings, without messing up other users. Second, it allows print setting to be changed "on the fly." For example, I may want to print out a draft Latex document in black and white mode at low resolution, then switch to printing out hi-resolution color figures on transparency paper. Xbubblejet allows me to make these changes instantly.

What printers are supported?

I have developed this using a Canon BJC-4200 BubbleJet printer. I have been told that it also works on other BJC-4XXXX series printers. Since the program makes use of ghostscript and specifies the device driver for a BJC-600, I assume it may work on a variety of other Canon printers as well.

Where do I get it?

The latest version is always available on this page. The entire package, with documentation, is availed as a tarred, gzipped, file which is linked to below.

xbubblejet-v0.2.tgz

Alternatively, you can download or view the following three files, which are included in the tgz file linked to above.

  • README-ASCII documentation file (practically identical to the contents of this WWW page)
  • xbubblejet - the GUI program (written in Tcl/Tk)
  • canon-filter.pl - the print filter (written in Perl)

What else do I need?

The Xbubblejet package was developed on a Linux system. However, in theory it should work on any UNIX/X system that has the following software installed:

  • Tcl/Tk - I used version 7.4, although earlier version may work.
  • Perl - I used version 4, although earlier versions may work.
  • ghostscript - it works with version 4.03 and higher. Earlier versions had some problems printing in color with the bjc600 device driver.
  • A printing facility that allows a print filter to be specified. This should be true on all UNIX systems. On most systems (including Linux), it is specified in the file /etc/printcap (see installation section).

How do I install it?

  1. Place the program xbubblejet in a common directory (like /usr/bin) where all users can run it
  2. Specify the print filter in your /etc/printcap file. For example, my /etc/printcap file looks like this:

    # START printcap file
    # /etc/printcap
    #
    lp:\
    :sd=/var/spool/lpd/lp:\
    :mx#0:\
    :sh:\
    :lp=/dev/lp1:\
    :if=/var/spool/lpd/lp/canon-filter.pl:
    #
    # END printcap file

    where the if= entry specifies the absolute path where the file canon-filter.pl file can be found. I placed it in /var/spool/lpd/lp, since other packages (like RedHat PrintTool) also store printer configuration files there.
  3. OPTIONAL: once you are familiar with the use of xbubblejet, you can copy a system wide file of default options to /etc/canon.ps.options. See the next section for more details.

How do I use it?

Run xbubblejet. Select the printer setting you want, then click on Done. A file named .canon.ps.options will be written to your home directory. When you go to print a file (via the lpr command) the print filter canon-filter.pl will read this file and setup the ghostscript drive to print your file appropriately.

If the user already has a .canon.ps.options file in their home directory, when xbubblejet the options file will be read and the buttons preselected to reflect the current settings. If a .canon.ps.options file does not exist in the user's home directory, the file /etc/canon.ps.options, if it exists, will be read by xbubblejet instead. Even in this case, however, the output will be written to .canon.ps.options in the user's gome directory. Likewise, the print filter canon-filter.pl will read the system-wide default options file /etc/canon.ps.options if the file .canon.ps.options does not exist in the user's home directory.

Problems

  1. First of all, reread the sections What else do I need? and How do I install it?. Make sure you have everything, and the files are where they belong. Set access permissions accordingly. Someday I will write an install script ...
  2. Xbubblejet works, but only prints in black and white.
  3. This is a problem with the bjc600 driver on earlier versions of ghostscript. Be sure that version 4.03 or newer is installed.
  4. It doesn't work at all. Nothing prints, and ghostscript reports a ".putdeviceprops" error on the console. This is due to a bug in the bjc600 drivers for ghostscript, at least on versions 5.03 and 5.50. A workaround is to used a modified version of xbubblejet that does not allow you to select the color mode (it will always be color). The modified version of xbubblejet is available here: xbubblejet-v0.2-nocolor.
  5. I get a "cannot find .canon.ps.options" error message. Several people have reported this, but nobody has responded to my replies asking for more information! If you get this error, please do the following:
    1. Ensure that the program "whoami" exists on your system and there is a path to it. For RedHat users, it is part of the sh-utils package.
    2. Email me with answers to the following questions: What distribution of Linux are you using? Are your home directories for users in /home? Did the error occur while running as root? What version of Tcl/Tk are you using?

Change Log

  • version 0.1: initial version
  • version 0.2
    • xbubblejet completely rewritten in a more modular form. Makes better use of lists and arrays in Tcl/Tk.
    • Added the capability of reading a user or system options file and preset the buttons accordingly.
    • Completely rewrote the print filter (now using Perl). This also eliminated a bug in the old print filter (a sh script) had a bug where if either of the first two characters of a file to be printed was a wildcard, it was expanded! So printing a C source-code listing that began with "/*" resulted in the printout containing a listing of the files in /home/root!
    • Added the capability of the print filter to read /etc/canon.ps.options is the file .canon.ps.options was not present in the user's home directory.

TO-DO List

In the short-term, I would like to see this integrated with more universal print filter packages, such as magicfilter and RedHat's PrintTool. I do not use either package, however, it appears that integrating with PrintTool should not be too hard -- it may simply require writing to postscript.cfg, or somehow allowing a user-specified verion of postscript.cfg to exist (maybe this is already done -- I don't know since I don't use it!).

In the long-term, it would be nice to modularize and expand xbubblejet into a more general program that has a database of config files for printers by various manufacturers. Since the utility of xbubblejet is intimately tied to the driver options in ghostscript, there is a well-defined list of features and printers that are supported.

Copyright Stuff

GNU Public License (see http://www.fsf.org for details). If you modify xbubblejet, I think that is great, and please let me know what you have done!

About the Author

The Xbubblejet package is written and maintained by Rob Butera. I am a scientist by day, and pursue a variety of computer, engineering, and artistic endeavors in my spare time. These hobbies include many things related to Linux and Lego® bricks. For my latest project where I have attempted to combine the two, visit Planet Brick. I can be reached by email at rob@butera.org, or visit my home page at http://www.butera.org/rob.