Printer Utility Program for Linux

(or any Unix O/S that supports GTK+ and GNU C)

The Sourceforge Pup project group page can be found here.
Main Web Site: pup.sourceforge.net  Mirror Sites: pup.hypermart.netpup.virtualave.net

Pup is a GUI utility for maintaining your printer under Linux or other operating systems that support Gtk+, Zlib, and GNU C.  Currently it supports the Lexmark Optra Color 40 , 45 , E310, and HP 2100M, 4000, and LJ4 Plus printers.  If your computer is configured for printer read back, Pup additionally supports all other PJL printers (or partially, depending on the printer).

The services Pup provides are ink cartridge maintenance/replacement (Lexmark Optra Color 40/45 only),  printing of various test and configuration pages,  querying of the printer's settings and status, and setting of the printer's defaults. Want to print a photo on the highest quality settings? No problem! Use Pup to set the printer's paper type, color correction, and print quality before printing the photo. 

This is Pup's main window. The two smaller pictures show the other tabs.
 

Pup Main Window
Printouts
Cartridge Maintenance

Along with PJL, the above listed printers have the advantage of supporting PostScript in the hardware. (The LJ 4 Plus requires an add on module for PostScript.) Postscript is the language Linux applications use for printing. If the printer is not Postscript capable then a program such as Ghostscript is used to convert the Postscript to the printer's language. Depending on the printer's language and how proprietary it is, Ghostscript may or may not do the best job. Usually text comes out fine but photos may be of lessor quality.
Reduced Image of Pup Preferences Window
A Postscript printer means no driver or filter is required to use it. The printer hardware itself interprets the Postscript. An application would send Postscript directly to the printer, bypassing Ghostscript.  When printing a non Postscript file from the command line, you would convert it to Postscript first.  A program such as a2ps can be used to convert text files.  The lpr command can be used to send a Postscript file to a Postscript printer by setting up a printcap entry without a filter. Alternatively you can just send the file directly to the printer device (e.g. cat filename.ps >/dev/lp0).

Note there are some printer manufacturers claiming a printer to be (or emulate) Postscript or claiming to have a Postscript option available for an extra charge, but somehow neglect to tell you the Postscript is supported in software only.  This means the printer will not support Postscript in Linux, as I know of no printer manufacturers writing drivers for Linux. The key thing to find out is if the printer supports Postscript or Postscript emulation in the hardware (such as the above listed printers).

Reduced Image of Set Printer Defaults Window
Pup issues printer commands in PJL (Printer Job Language) or PostScript. For the cartridge maintainance it issues binary NPA commands specific to the Lexmark Optra 40/45. The setting of printer defaults can be accomplished in two ways: through the Dynamic Choices window (if you have printer read back) or the Fixed Choices window. The Dynamic Choices window queries the printer and then presents a list of choices for you to change based on what came back from the printer. That's why it can (potentially) support any PJL printer. The Fixed Choices window is intended for those folks without printer read back as it works in uni-directional mode. The choices presented are based on the above listed printers I queried before hand and hard coded into Pup. The Dynamic Choices window high-lights current settings in red for you to verify your changes; for the Fixed Choices window you will have to print a settings page to verify your changes. The Fixed Choices window does not offer as many choices as the Dynamic Choices window because I elliminated those choices that cannot be verified on the printed settings page (the printer does not print all settings available); therefore it is better to get your system configured for printer read back and use the Dynamic Choices window.
Reduced Image of Help Window
Pup uses GTK+   ( The Gimp Toolkit) for its GUI, and Zlib to store some compressed things. You must have libgtk, gdk-imlib1, libglib, and zlib to run it. To compile it you also need the related header files. This program is simple enough to refer to when learning GTK and provides examples of a lot of the various widgets and setting some of the attributes. I wrote pup so I could learn GTK. I learned by referring to the GTK tutorial and Eric Harlow's book, Developing Linux Applications with GTK+ and GDK,  reading through the GTK and GDK header files, and of course a lot of experimentation. I would like to acknowledge the folks who gave us GNU C,  Linux, XFree86, GTK+,  Zlib,  and uuencode, without which I could not have written this program. Thanks!

There is also a stand alone program included in the source code called mydeflate.c, which can be compiled separately. It will compress and base64 encode any file, which you can put into an array and write some code to decode and uncompress it as needed. Pup does this with some images and PostScript it uses for some output commands, line by line on the fly during output as an example of a way to save run-time memory. See the source file header for more information.

Pup offers what I call Explain technology. Explain Button  Simply put, when Pup cannot complete a command successfully, instead of crashing and/or bringing down the whole operating system which might normally happen on another platform,  it pops up the Explain button which will bring up a window stating and explaining the error detected, and offer suggestions as to how to fix the problem. This happens when and where it is needed. Even if you forget to turn your printer on or hook up the printer cable, Pup's Explain technology will politely inform you. Likewise,  you may cycle the printer's power or switch printers without crashing Pup or the operating system. 

Pup outputs commands to a printer, a pipe to a printer, or a file. Inputs (queries) are only allowed from a printer device. If you output commands to a file, you may ftp this file to a remote printer or cat it directly to an output device in order to execute the commands.

I have released pup under the GNU General Public License (GPL). This means anyone can download, use, modify, and redistribute it as long as the source code goes with it. Read the GPL for more info. It can be found here and is also included with the download. I would ask, however, that any modifications useful to others be resubmitted to me so that I may maintain the master copy.

The source code and compiled binary (for Linux on x86) are available for download.  The sources have a simple Makefile and should not give you problems. Of course it goes without saying that you need to have development capabilities installed on your system, i.e. Make, gcc, includes, and applicable libraries. 

Reduced Image of Ink Gauge Reset Window
The  README  file accompanying Pup has more information about Pup's features, supported printers, and platforms, as well as instructions on how to add support for your PJL printer. It also tells how to filter out choices you don't want showing up in the Dynamic Choices window. Pup's help windows provide additional explanations on each feature.

In addition to other formats, I am now offering Pup as a Debian package. I am currently in the process of becoming a Debian maintaner and will soon have Pup on the Debian web site. The package is available here too.

Reduced Image of Cartridge Alignment Window

Versions

1.1 September '00 New features!
1.0.2 February '00 Fixed read test.
1.0.1 January '00 JIT I/O; Piping support added.
1.0 August '99 Initial release. Cartridge maintainance only.

Ideas (for 1.2 ?)

Add an option to read PPD files; add network support for the query features; add ability to filter choices through the GUI.

Notes

Sourceforge.net is the home for Pup. Previously it was released at http://pup.virtualave.net and http://pup.hypermart.net These two other sites are now mirrors of this web page with downloading available from there. Links are provided at the top of this page. Please note on these other sites the download links point to a cgi script first, which I only use to count the number of downloads.

Reduced Image of Cartridge Install Window
The Pup project group page can be found here.

Pup is tuned for 1280x1024 displays, and looks good down to 1024x768. For 800x600, some of the windows are too tall. This can easily be fixed by changing the source code (search on "height"). For 640x480, forget it. If you really want to use 640x480 or Pup is too big to suite you for 800x600, in addition to changing the height (and width) you can also change to a smaller font. The default font is set at the beginning of the program in main() and all other fonts are set in set_font().

To be able to use Pup as not root, either change permissions to the output device (e.g. /dev/lp0) or add your user to the group that belongs to this device and make sure it has group rw permission.

Download

v1.1 Source Code RPM Sept '00 pup-1.1-1.src.rpm
v1.1 Linux x86 Binary RPM Sept '00 pup-1.1-1.i586.rpm
v1.1 x86 Binary DEB Sept '00 pup_1.1-1_i386.deb
v1.1 Source Code Sept '00 pup_1.1_src.tar.gz
v1.1 x86 Binary for Linux Sept '00 pup_1.1_i386.tar.gz
       
v1.0.2 Source Code RPM March '00 pup-1.0.2-0.src.rpm
v1.0.2 Linux x86 Binary RPM March '00 pup-1.0.2-0.i386.rpm
v1.0.2 Source Code Feb '00 pup_1.0.2_src.tar.gz
v1.0.2 x86 Binary for Linux  Feb '00 pup_1.0.2_bin.tar.gz
v1.0.1 Source Code Jan '00 pup_1.0.1_src.tar.gz
v1.0.1 x86 Binary for Linux  Jan '00 pup_1.0.1_bin.tar.gz
v1.0  Source Code Aug '99 pup_1.0_src.tar.gz
v1.0 x86 Binary  for Linux  Jan '00 pup_1.0_bin.tar.gz

You do not have to reboot or restart X after installing Pup. Please dismiss this idea :0)

Package Instructions

RPM
1. Become root.
2. If an older version of pup (RPM) is installed, type rpm -qa | grep pup  to get the package name. To remove this package, type rpm -e pup-x.x  where pup-x.x  is the name of the old package.
3. To install, type  rpm -i pup-1.1-1.src.rpm  or  rpm -i pup-1.1-1.i586.rpm
4. Remove the rpm file: rm pup-1.1-1.src.rpm  or  rm pup-1.1-1.i586.rpm
5. Log out of root.
6. Refresh your paths:    rehash for tcsh or hash -r for bash.
7. If you installed the binary package, read the README file in /usr/doc/pup; also type:  man pup
8. Type: pup

DEB
1. Become root.
2. Install the package: dpkg -i pup_1.1-1_i386.deb
3. Remove the deb file: rm  pup_1.1-1_i386.deb
4. Log out of root.
5. Refresh your paths:    rehash for tcsh or hash -r for bash.
6. Read the README file in /usr/share/doc/pup; also type:  man pup
7. Type: pup

Manual Instructions

Binary (for Linux on x86)
1. Download pup_1.1_bin.tar.gz to a clean directory.
2. Gunzip it:    gunzip pup_1.1_bin.tar.gz
3. Untar it:   tar -xvf pup_1.1_bin.tar
4. Remove the tar file:    rm pup_1.1_bin.tar
5. Copy the binary file pup to /usr/local/bin or other desired directory in your path. Copy the pup.1.bz2 file to your man1 directory. If your manual does not support bz2, convert pup.1.bz2 to pup.1.gz (bzip2 -d pup.1.bz2 then gzip pup.1) or just place pup.1 there.
6. Refresh your paths:    rehash for tcsh or hash -r for bash.
7. Read the README file; also type: man pup
8. Type:    pup
9. If you get errors because of missing libraries, remember you need the runtime libraries libgtk, gdk-imlib1,  libglib, and zlib to run it. Install these from your Linux distribution. If you get other library errors,  perhaps your libraries are not the same versions I compiled pup with;  remove your pup files and download the source code.  Follow the instructions below.

Source
1. Download pup_1.1_src.tar.gz to a clean directory.
2. Gunzip it:    gunzip pup_1.1_src.tar.gz
3. Untar it:       tar -xvf pup_1.1_src.tar
4. Remove the tar file:    rm pup_1.1_src.tar
5. Change directories to pup_1.1
6. Install the runtime and development libraries of libgtk, gdk-imlib1,  libglib, and zlib if not already installed.  Note these libraries depend on other libraries to be installed. If you use Debian Linux, the web site is quite handy about telling you which dependencies are required for a package. 
7. Read the README file.
8. Type:    make
9. Copy the resulting binary file pup to /usr/local/bin or other desired directory in your path. Copy the pup.1.bz2 file to your man1 directory. If your manual does not support bz2, convert pup.1.bz2 to pup.1.gz (bzip2 -d pup.1.bz2 then gzip pup.1) or just place pup.1 there.
10. Refresh your paths:  rehash for tcsh or hash -r for bash.
11. Type:  man pup
12. Type:  pup

If any of the above steps required you to become root, be sure to log out and run Pup as a normal user. (You may have to change permissions on your output device.) When Pup comes up, go to the Help menu and select Info to read about each option. If you want to test out the code without affecting your printer, just type a bogus filename in the Output box; the commands will be written to this file which you can delete later.