[cups.development] Add Network Printer through libcups API

Michael R Sweet msweet at apple.com
Thu Jun 19 12:17:45 PDT 2008


Russell Stewart wrote:
> Hey all. I'm hoping somebody can help me with this.
> 
> I need to add a network printer by IP address using the libcups C/C++ API. I.e., I need to do the programmatical equivalent of:
> 
> lpadmin -p hplj -v socket://192.168.0.6:9100/ -E
> 
> (Not sure if the syntax of that command is perfect, but I'm sure you get the point).
> 
> I've been poring over the libcups API documentation, and I am very confused at this point. There's a function called "cupsAddDest", but in the documentation for that it says, "This function cannot be used to add a new class or printer queue, it only adds a new container of saved options for the named destination or instance". So that doesn't sound right.
> 
> What am I missing here? Can anyone point me in the right direction?

You need to create an IPP request and send it using cupsDoFileRequest
(assuming you are using a PPD file or interface script for the queue)

-- 
______________________________________________________________________
Michael R Sweet                        Senior Printing System Engineer





More information about the cups-devel mailing list