Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

CUPS_SERVER API #145

Closed
kaihendry opened this Issue · 8 comments

2 participants

Kai Hendry patrickhaller
Kai Hendry
Owner

An API to set /etc/cups/client.conf makes more sense I think.
http://www.cups.org/documentation.php/doc-1.4/ref-client-conf.html

For example, cups=servername%20192.168.43.85

Would write that to /etc/cups/client.conf on Webconverger, so that it could use the shared IPP printers about the printing host 192.168.43.85.

Kai Hendry
Owner

client.conf is not a great solution as that only works between CUPS servers, which a IPP network printer does not have.

Depressingly, when trying Avahi and all its dependencies, detected printers are not automatically found in the print dialog.

http://s.natalian.org/2013-03-13/add-printer.png
http://s.natalian.org/2013-03-13/add-printer3.png

Kai Hendry
Owner

http://ix.io/4Mf

The future printer IIUC can handle PDF directly. However currently, network printers usually have reliable "Laser Printer" PCL support and somewhat reliable PostScript support.

 lpadmin -p printername -E -v http://192.168.5.142/printer -m drv:///sample.drv/generpcl.ppd

Sets up Ricoh printer on 192.168.5.142 with the PCL driver. Alternatively one could specify the postscript driver with -m drv:///sample.drv/generic.ppd from the list produced by lpinfo -m.

If one wants to specify a PPD. http://ix.io/4Mg We could download the PPD beforehand, interrogate lpinfo -m for the driver URL and then setup the printer accordingly.

Knowing this, how about a printer API like this:

printer=printername,device_uri,driver_uri

e.g.

printer=Level2,http://office/printer,drv:///sample.drv/generic.ppd

If the driver_uri is of the http:// form, it downloads the PPD to /usr/share/ppd/cupsfilters. We need to compare a lpinfo -m > before & lpinfo -m > after to determine the right lsb/usr/... driver_uri.

patrickhaller

Should be able to just use the path to the PPD file, as in:

cups_home=/etc/cups/
[[ "$driver_uri" ~ ^http: ]] && {
wget -O ${cups_home}/user_ppd_file "$driver_uri"
lpadmin -p $printer_name -E -d -m ${cups_home}/user_ppd_file
}

Kai Hendry
Owner

Yes, or using the -i as suggested here http://cups.org/newsgroups.php?s25828+gcups.general+v25843+T1

patrickhaller
Kai Hendry
Owner

-i does seem to work on Webconverger 18. I wish I could figure out how to list the printers from the command line.

patrickhaller
Kai Hendry kaihendry closed this in 8def46d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.