Simple custom driver for text-based print queue

Helge Blischke h.blischke at acm.org
Fri Aug 24 06:41:42 PDT 2012


David wrote:

> Hello,
> 
> I have a couple of labelprinters that are defined in CUPS as "raw" print
> queues or using the Generic/Text-only "driver".
> 
> We are sending print commands (ASCII files) directly to the printers,
> everything working fine so far.
> 
> Now I want to have a custom printer driver in CUPS that manipulates the
> file sent to the printer. I want to replace some characters in the print
> job. I am able to write a simple shell/perl script that would do this, but
> I have no idea how I can get this done in CUPS or how to integrate a shell
> script that can read the print job, modify and spool it out again to the
> printer.
> 
> Does anyone of you have ideas or recommendations or even examples to start
> with?
> 
> I am using cups 1.3.8 at the moment.
> 
> Thanks in advance,
> David.

Write a script (shell, Perl, Python or whatever) which does the required 
manipulations and attach it to the print queue via the lpadmin command with 
the "-i path_to_interface_script" option.

Note that the interface script follows the same conventions as filters with 
respect to input, output, and command line options as ordinary filters (see 
man filter).

Helge





More information about the cups mailing list