Webconverger / webc

Webconverger's curated chroot from which updates originate
https://webconverger.org/upgrade/
73 stars 37 forks source link

CUPS_SERVER API #145

Closed kaihendry closed 11 years ago

kaihendry commented 11 years ago

http://cups.org/newsgroups.php?s25802+gcups.general+v25820+T0

http://www.cups.org/documentation.php/doc-1.4/sharing.html

CUPS_SERVER=server:port firefox http://www.cups.org
kaihendry commented 11 years ago

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.

kaihendry commented 11 years ago

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

kaihendry commented 11 years ago

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 commented 11 years ago

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 }

kaihendry commented 11 years ago

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

patrickhaller commented 11 years ago

On 2013-03-17 22:37, Kai Hendry wrote:

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

Must test. My docs say that -i Sets a System V style interface script for the printer

Does not sound like a PPD file :(

kaihendry commented 11 years ago

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

patrickhaller commented 11 years ago

On 2013-03-17 22:47, Kai Hendry wrote:

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

lpinfo -v or awk '/<Printer/ { print $2 }' /etc/cups/printers.conf | sed -e 's/.$//'