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



Michael,

I've replaced my edit to printers.conf with a call to lpadmin, and it resolved my issue.

Thanks,
Josh Klun - Product Manager, Engineer - BrighTech, Inc - 612• 317• 0737 x105 - email@hidden

---------------------------------------------------------------------------------------------
Electronic Privacy Notice 
The present e-mail, and all of its attachments, contains information that is covered by the US and/or international electronic communications privacy laws, and is confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from keeping, using, duplicating, distributing, or otherwise disclosing any of this information in any form. Instead, please notify the sender that you have received this message in error, and then immediately delete it. 
Thank you in advance for your cooperation,
BrighTech, Inc.
=============================================================================================



On Nov 16, 2007, at 1:23 PM, Michael R Sweet wrote:

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>)
 >Re: Adding a printer programatically in Leopard (From: Michael R Sweet <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.