4

We are having some success printing via Googles Cloud Print service. But wondering if anyone has information regarding the capabilities parameter when submitting a job to print and some pointers in how to create and work this format which I believe is ppd.

We have been able to get the capabilities of the printer via using the method http://www.google.com/cloudprint/printer which returns all the values for our printer. The problem is we don't quite understand what we are meant to do with this in order to define the capability options we would like to print with. This would include options for the copies of pages printed, paper type and print quality. An example of the capabilities information we can receive is like this :

{
    "name": "copies",
    "displayName": "Copies",
    "type": "ParameterDef"
}

{
     "UIType": "PickOne",
     "name": "HPEconoMode",
     "displayName": "EconoMode",
     "type": "Feature",
     "options": [
      {
       "ppd:value": "\"\"",
       "default": true,
       "name": "PrinterDefault",
       "displayName": "Printer's Current Setting"
      },
      {
       "ppd:value": "\u003c\u003c/EconoMode true\u003e\u003e setpagedevice",
       "name": "True",
       "displayName": "Save Toner"
      },
      {
       "ppd:value": "\u003c\u003c/EconoMode false\u003e\u003e setpagedevice",
       "name": "False",
       "displayName": "Highest Quality"
      }
     ]
    }
Eugene Manuilov
  • 4,271
  • 8
  • 32
  • 48

1 Answers1

1

The GCP documentation is badly lacking in this regard. Anyway, I've managed to find that the correct parameter to send printer settings is ticket, not capabilities. The first part of the parameters corresponds to the basic settings from the print dialog and they are quite self-explanatory and the values are easy to change. The vendor_ticket_item array is a bit more complicated. It contains id/value pairs described by the printer capabilities. The id will contain the name of the parameter from the capabilities and the value will contain the name of one of the records in the parameter options, or a numeric value etc, as described in the capabilities.

For mode details please take a look at my full solution.

{
"version":"1.0",
 "print":{
    "color":{"vendor_id":"psk:Color","type":0},
    "duplex":{"type":0},
    "page_orientation":{"type":1},
    "copies":{"copies":1},
    "dpi":{"horizontal_dpi":600,"vertical_dpi":600},
    "media_size":{"width_microns":148000,"height_microns":210000,"is_continuous_feed":false},
    "collate":{"collate":true}
    ,
    "vendor_ticket_item":[
        //Printer specific settings here, from the capabilities:
        {"id":"psk:JobInputBin","value":"ns0000:Tray3"},
        {"id":"psk:PageICMRenderingIntent","value":"psk:Photographs"},
        {"id":"psk:PageMediaType","value":"ns0000:Auto"},
        {"id":"psk:JobOutputBin","value":"ns0000:Auto"},
        //etc.
    ]
 }
}
Community
  • 1
  • 1
dcb
  • 531
  • 3
  • 15