Classes and Priorities

Helge Blischke h.blischke at acm.org
Thu Mar 4 10:10:14 PST 2010


Timetrinus wrote:

>> Timetrinus wrote:
>>
>> > Hello!
>> >
>> > We are creating postscript files that are transferred to 3g / gprs
>> > connected laptops in the field via lpd. For doing this every laptop has
>> > a so called "Mobile" printqueue. This Printqueue defaults to a cups-pdf
>> > backend. But in case the user connects a usb printer the printjob has
>> > to be printed out there instead of creating a PDF.
>> >
>> > I thought about cups classes for automatically handling this behaviour.
>> > So I would create a class Mobile and put in a PDF-Printer and if user
>> > connects a USB Printer add it to this class. But: is it possible to
>> > configure the class to use PDF-Printer only if no other printer is
>> > configured in the queue? Disabeling the PDF-Printer in case the User
>> > connects a USB Printer is not a good Idea because from local
>> > Applications (for example openoffice, or browser) the user should be
>> > able to create PDF output every time.
>> >
>> > Thanks in advance!
>>
>> As for current CUPS, you need to set up sort of a "store and forward"
>> printer which uses a backend script that forwards the job to the real
>> printer if it is connected but otherwise to the pdf-printer.
>> The details of such a configuration depend on the properties of the
>> possible real printers.
>>
>> Helge
>>
> 
> Helge, thank you for reply.
> 
> Can you please point me to the documentation for such a solution? What do
> you mean with "... the properties of the possible real printers." ?
> 
> Thank you!

I'm not aware of any written documentation on this topic, so let me sketch 
out how I think it could work.

As for different properties if connected printers:
if you must account for different make and models to be plugged in on the 
laptops, these printers usually have different set of properties (e. g. 
color or b/w, duplex or not, etc. etc.)

If the printers to be considered have sufficient common properties, you 
could create a PPD describing the common propoerties subset for the "virtual 
printer". Otherwise you need to configure the "virtual printer" as a raw 
printer (possibly with a SYSV interface script for serving special 
requirements).

The Backend for the virtual printer should probably be a script which tests 
if there is a real USB printer online (perhaps by calling the original usb 
backend without parameters) and then either calling the backend for the real 
printer (either the usb or cups-pdf backend) in case of the virtual printer 
having a PPD or printing the data to rhe teal printer, preserving the 
options.

For a more detailed discussion, tell me more about your configuration, cups 
version etc. and contact me off the ng (h dot blischke at acm dot org).

Helge







More information about the cups mailing list