Xpra: Ticket #1344: better printer options handling and forwarding

Original remote printing feature ticket: #598, wiki: wiki/Printing.

As per r14232, we only allow a limited set of printing options from the server. We should instead tell the server which options are available on this printer and expose it somehow to the print dialog shown there. At the very least we should handle "copies". Then when we get a print request, we can honour those settings we know the printer can handle, and validate the values against the list of valid options the printer exposes.

ie for a "Canon iP2700" printer, cups shows:

$ lpoptions
copies=1 device-uri=usb://Canon/iP2700%20series?serial=C865B2 finishings=3 job-cancel-after=10800 \
    job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=0 number-up=1 \
    printer-commands=none printer-info='Canon iP2700 series' printer-is-accepting-jobs=true \
    printer-is-shared=true printer-location=localhost.localdomain \
    printer-make-and-model='Canon iP2700 series - CUPS+Gutenprint v5.2.11 Simplified' \
    printer-state=3 printer-state-change-time=1477029207 printer-state-reasons=none \
    printer-type=167948 printer-uri-supported=ipp://localhost/printers/iP2700-series
$ lpoptions  -l
PageSize/Media Size: Letter Legal Executive Postcard CD5Inch CD3Inch CDCustom w144h432 \
    w288h432 w288h432J Statement w612h864 *A4 d-o400x600 d-o100x400 d-o131x400 d-o056x344 \
    d-o319x350 d-o100x263 d-o200x100 d-o200x150 d-o200x400 d-o225x550 d-o300x200 d-o300x300 \
    d-o319x175 d-o350x200 d-o400x200 d-o400x300 d-o400x400 d-o400x500 d-o400x650 d-o400x800 \
    d-o400x1300 d-o600x200 d-o600x300 d-o600x400 d-o600x500 d-o600x600 d-o800x1200 d-o850x600 \
    d-o850x1100 d-o250x313 d-o050x175 d-o175x300 d-o075x575 d-o44x31 d-o62x44 d-o74x52 \
    d-o88x62 d-o105x74 d-o125x88 d-o148x105 d-o176x125 d-o210x148 Custom.WIDTHxHEIGHT
ColorModel/Color Model: Gray Black *RGB CMY CMYK KCMY
MediaType/Media Type: *Plain PhotoPlusGloss2 PhotoPro2 PhotoProPlat PhotoProSemiGloss \
    GlossyPaper PhotopaperMatte Coated HagakiA InkJetHagaki CanonPhotoHagakiK Hagaki \
    TShirt Envelope PhotopaperOther
InputSlot/Media Source: *Rear
StpQuality/Print Quality: None *Standard
Resolution/Resolution: *601x600dpi 600dpi 602x600dpi 300dpi 603x600dpi 604x600dpi 301x300dpi 605x600dpi \
    606x600dpi 302x300dpi 1200x600dpi 607x600dpi 608x600dpi 609x600dpi 610x600dpi 611x600dpi 612x600dpi \
    613x600dpi 614x600dpi
StpiShrinkOutput/Shrink Page If Necessary to Fit Borders: *Shrink Crop Expand
StpCDInnerRadius/CD Hub Size: *None Small
StpInkType/Ink Type: *CMYK RGB Gray
StpInkSet/Ink Set: *Both Black Color
StpFullBleed/Borderless: *False True
StpColorCorrection/Color Correction: *None Accurate Bright Hue Uncorrected Desaturated Threshold Density Raw Predithered
StpBrightness/Brightness: 0 100 200 300 400 500 600 700 800 900 *None 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 Custom.REAL
StpContrast/Contrast: 0 100 200 300 400 500 600 700 800 900 *None 1100 1200 1300 1400 1500 1600 1700 1800 \
    1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400 3500 3600 3700 3800 \
    3900 4000 Custom.REAL
StpSaturation/Saturation: 0 100 200 300 400 500 600 700 800 900 *None 1100 1200 1300 1400 1500 1600 1700 \
    1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400 3500 3600 3700 \
    3800 3900 4000 4100 4200 4300 4400 4500 4600 4700 4800 4900 5000 5100 5200 5300 5400 5500 5600 5700 \
    5800 5900 6000 6100 6200 6300 6400 6500 6600 6700 6800 6900 7000 7100 7200 7300 7400 7500 7600 7700 \
    7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 Custom.REAL
StpImageType/Image Type: None Text Graphics *TextGraphics Photo LineArt


Fri, 21 Oct 2016 06:09:39 GMT - Antoine Martin: status, description changed


Mon, 06 Nov 2017 08:53:35 GMT - Antoine Martin:

For reference, here's another printer:

$ lpoptions
copies=1 device-uri=usb://Canon/G2000%20series?serial=128621&interface=1 finishings=3 job-cancel-after=10800 job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=0 number-up=1 printer-commands=none printer-info='Canon G2000 series' printer-is-accepting-jobs=true printer-is-shared=true printer-is-temporary=false printer-location=desktop printer-make-and-model='Canon G2000 series - CUPS+Gutenprint v5.2.13 Simplified' printer-state=5 printer-state-change-time=1509685456 printer-state-reasons=paused printer-type=167948 printer-uri-supported=ipp://localhost/printers/G2000-series
$ lpoptions  -l
PageSize/Media Size: Letter Legal Executive Postcard CD5Inch CD3Inch CDCustom w144h432 w288h432 w288h432J Statement w612h864 *A4 d-o400x600 d-o100x400 d-o131x400 d-o056x344 d-o319x350 d-o100x263 d-o200x100 d-o200x150 d-o200x400 d-o225x550 d-o300x200 d-o300x300 d-o319x175 d-o350x200 d-o400x200 d-o400x300 d-o400x400 d-o400x500 d-o400x650 d-o400x800 d-o400x1300 d-o600x200 d-o600x300 d-o600x400 d-o600x500 d-o600x600 d-o800x1200 d-o850x600 d-o850x1100 d-o250x313 d-o050x175 d-o175x300 d-o075x575 d-o44x31 d-o62x44 d-o74x52 d-o88x62 d-o105x74 d-o125x88 d-o148x105 d-o176x125 d-o210x148 A4-div2 A4x4inch A4x5inch A4x6inch A4x8inch A4x10inch A4x10inch-div2 Custom.WIDTHxHEIGHT
ColorModel/Color Model: Gray Black *RGB CMY CMYK KCMY
MediaType/Media Type: *Plain PhotoPlusGloss2 PhotoProLuster PhotoProSemiGloss GlossyPaperStandard PhotopaperMatte Coated InkJetHagakiaddr InkJetHagaki InkjetPhotoHagakiKaddr InkjetPhotoHagakiK HagakiA Hagaki TShirt Envelope PhotopaperOther
InputSlot/Media Source: *Rear
StpQuality/Print Quality: None *Standard
Resolution/Resolution: *601x600dpi 600dpi 602x600dpi 300dpi 603x600dpi 604x600dpi 605x600dpi 606x600dpi 607x600dpi
StpiShrinkOutput/Shrink Page If Necessary to Fit Borders: *Shrink Crop Expand
StpCDInnerRadius/CD Hub Size: *None Small
StpInkType/Ink Type: *CMYK RGB Gray
StpInkSet/Ink Set: *None
StpFullBleed/Borderless: *False True
StpOrientation/Orientation: *Portrait Landscape UpsideDown Seascape
StpColorCorrection/Color Correction: *None Accurate Bright Hue Uncorrected Desaturated Threshold Density Raw Predithered
StpBrightness/Brightness: 0 100 200 300 400 500 600 700 800 900 *None 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 Custom.REAL
StpContrast/Contrast: 0 100 200 300 400 500 600 700 800 900 *None 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400 3500 3600 3700 3800 3900 4000 Custom.REAL
StpSaturation/Saturation: 0 100 200 300 400 500 600 700 800 900 *None 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400 3500 3600 3700 3800 3900 4000 4100 4200 4300 4400 4500 4600 4700 4800 4900 5000 5100 5200 5300 5400 5500 5600 5700 5800 5900 6000 6100 6200 6300 6400 6500 6600 6700 6800 6900 7000 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 Custom.REAL

Wed, 15 Nov 2017 11:28:53 GMT - Antoine Martin: description, milestone changed


Sun, 26 Nov 2017 14:04:18 GMT - Antoine Martin:

See also #1228


Sat, 23 Jan 2021 05:21:41 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1344