Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding a printer programatically in Leopard



Josh Klun wrote:
On Tiger, we added "virtual printer" to cups, for internal use by our application. We created a script in /usr/libexec/cups/backend/, copied a PPD to /private/etc/cups/ppd/ and updated /private/etc/cups/printers.conf. Once the printer is added, we select & control it with lpoptions, lpadmin, lpstat, etc.

How are you updating printers.conf?

In general, manipulating printers.conf directly is a bad idea and
is highly dependent on the version of Mac OS X or CUPS you are
using...

Unfortunately, none of this works on Leopard. The cups operations are all successful and internally consistent, but none of the changes are propagated to the GUI/application level. Selecting & querying the current printer can be performed using AppleScript on "Printer Setup Utility", but I haven't figured out how to programatically add a printer (particularly with a cups backend). Is there a recommended way to add a CUPS printer on Leopard? Is there a way to sync the cups configuration into the configuration used by the print dialog & system preference?

Either use lpadmin or the CUPS API with the CUPS_ADD_PRINTER operation (the lpadmin source code should provide a good source of inspiration for the latter...)

--
______________________________________________________________________
Michael R Sweet                        Senior Printing System Engineer
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Printing mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/printing/email@hidden

This email sent to email@hidden
References: 
 >Adding a printer programatically in Leopard (From: Josh Klun <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.