We got a new printer, a Konica Minolta bizhub c365e, but to be able to print from Linux/CUPS with usage tracking enabled on the printer there need to be some adjustments to the supplied PPD file from Konica Minolta. There is a way to to do this via CUPS and a custom cups filter, here I will describe another way.

Usage tracking

We want to track the printer usage separated by workgroup. The printer is setup so that you have to type a code before you can copy or scan documents. This setting also makes it impossible to send print jobs without proper tracking information, the printer would discard the jobs directly. The blog post in the above link documented a way which uses a custom CUPS filter to accomplish this. I found that one can modify the PPD so that an extra filter is not needed. One can also easily extend this to enable a selection of account numbers.

(BTW: In order to print with cups from Debian Wheezy I needed to use the pstopdf filter instead of gs: lpadmin -p your_printer -o pdftops-renderer-default=pdftops )

Principle

The idea is to expose the specific information to the printer just before the actual print job. The print itself job will be embedded. There is a special JCL (Job Control Language) to facilitate this, the only problem is to find the proper commands. For the Konica Minolta there are three variables needed to accept the print job:

  • KMSECTIONNAME: the account name
  • KMSECTIONKEY2: the password
  • KMCOETYPE: the password type (0 = plain text, 2 = encrpyted)

The printer understands PJL (Printer Job Language) so we will use that to send the data. For the impatient, here are the lines to be added to your PPD file:

*% JCL Information 
*JCLBegin: "<1B>%-12345X@PJL JOB<0A>"
*JCLToPSInterpreter: "@PJL ENTER LANGUAGE=POSTSCRIPT<0A>"
*JCLEnd: "<1B>%-12345X@PJL EOJ<0A><1B>%-12345X"

*JCLOpenUI *JCLTracking/Account Tracking: PickOne
*DefaultJCLTracking: some_default_name
*OrderDependency: 5 JCLSetup *JCLTracking
*JCLTracking same_default_name/Your Default Name:   "@PJL SET KMSECTIONNAME = <22>AG Vogel<22> <0A>@PJL SET KMSECTIONKEY2 = <22>1234<22><0A>@PJL SET KMCOETYPE = 0<0A>"
*JCLTracking same_other_name/Your Other Name: "@PJL SET KMSECTIONNAME = <22>Your Other Name<22><0A>@PJL SET KMSECTIONKEY2 = <22>1234<22><0A>@PJL SET KMCOETYPE = 0<0A>"
*JCLCloseUI: *JCLTracking

This will create a new menu in CUPS printer interface where you can select your account. The letter between < and > are ASCII Hexcodes which will be interpreted. For example <22> = " and <0A> = \n.

Print Dialogue for this printer with Usage Tracking

Obviously, if security is of concern this will not be useful for you because the users can easily access the account password.

If you do not need/want the selection dialogue you could add the PJL commands to the *JCLBegin parameter.

References

Followings sites were very helpful: