Thursday, July 28, 2011

printing on a canon printer from linux with job accounting

At work we have this Canon iRC2550i network printer. Job accounting (username and password) is used to protect against unauthorized used of the printer / photocopier. Unfortunately, it does not work out of the box under Linux. So here is how to do it. (Note: I had to try lots of things before I managed to make this work, so maybe there were so hidden steps...)

- Download and install the UFR II driver from Canon
Choose the UFR_II driver. This is an archive file, unpack it and go to the 32 bit debian folder.

Before installing the debs there is a small trick, as they depend on gs-esp and it has been removed from the repo starting from Maverick.

Make sure ghostscript-x is installed (sudo apt-get install ghostscript-x)
Generate a fake gs-esp package:

Install equivs (sudo apt-get install equivs)
echo "Package: fake-gs-esp" > fake-gs-esp.control
echo "Provides: gs-esp" >> fake-gs-esp.control
equivs-build fake-gs-esp.control
sudo dpkg -i fake-gs-esp_1.0_all.deb
Then install the UFR cups drivers:
sudo dpkg -i cndrvcups-common_2.20-1_i386.deb
sudo dpkg -i cndrvcups-ufr2-uk_2.20-1_i386.deb

- Add the printer on your system (Cups) using the UFR II driver: HP JetDirect

- Configure the job accounting:
sudo cnjatool -e [printer name] (to enable job accounting)
cnjatool -p [printer name] (to set the username and password)

Optionally, cngplp can be used to configure the printer (it's a GUI)