[cups.development] Determine hardware and virtual printers

Michael Sweet msweet at apple.com
Tue Sep 8 20:37:55 PDT 2009


On Sep 8, 2009, at 5:10 PM, Dmitry wrote:
>> On Sep 8, 2009, at 10:44 AM, Dmitry wrote:
>>> Hi. Is there a way in CUPS API to determine which printers are
>>> hardware and which are virtual?
>>
>> What do you mean by virtual?
>
> Virtual printer is not hardware printer :) CUPS-PDF for example.

Sorry, there is no generic way to know the difference between a real  
printer and this kind of printer.

>> If you are looking to determine whether
>> a particular printer is a class or a specific printer, you can look  
>> at
>> the printer-type value returned in the options array for each
>> destination returned by cupsGetDests().
>>
>
> Where the possible values of printer-type are documented?

The CUPS IPP spec documents the printer-type values:

     http://www.cups.org/documentation.php/spec-ipp.html

There are also definitions in the <cups/cups.h> header.

>> If you are trying to determine whether you'll be printing or saving  
>> as
>> PDF, for example, then you'll need to know about the device URIs used
>> by each of the third-party solutions - then you can just look at the
>> device-uri for each printer and determine from there.
>>
>> That said, why do you need to know this information?  Why do you  
>> care?
>>
>> ___________________________________________________
>> Michael Sweet, Senior Printing System Engineer
>>
>
> I'd like to show to user only hardware printers. All virtual  
> printers like CUPS-PDF should be ignored in my program.


That's going to be really really hard to do effectively.

___________________________________________________
Michael Sweet, Senior Printing System Engineer







More information about the cups-devel mailing list