CUPS_SERVER API #145

Closed
kaihendry opened this Issue Mar 13, 2013 · 8 comments

Comments

Projects
None yet
2 participants
Owner

kaihendry commented Mar 13, 2013

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.

Owner

kaihendry commented Mar 13, 2013

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

Owner

kaihendry commented Mar 18, 2013

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.

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
}

Owner

kaihendry commented Mar 18, 2013

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

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 :(

Owner

kaihendry commented Mar 18, 2013

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

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/.$//'

kaihendry closed this in 8def46d Mar 18, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment