谷歌云打印和功能PPD


Google Cloud Printing and Capabilities PPD

我们通过谷歌云打印服务打印取得了一些成功。但想知道是否有人在提交打印作业时有关于capabilities参数的信息,以及如何创建和使用这种格式的一些指针,我认为这种格式是ppd。

我们已经能够通过使用该方法获得打印机的功能http://www.google.com/cloudprint/printer它返回我们打印机的所有值。问题是,我们不太明白我们应该如何处理它,以定义我们想要打印的功能选项。这将包括打印页数、纸张类型和打印质量的选项。我们可以收到的能力信息示例如下:

{
    "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"
      }
     ]
    }

GCP文档在这方面严重缺乏。无论如何,我已经设法发现发送打印机设置的正确参数是票证,而不是功能。参数的第一部分对应于打印对话框中的基本设置,它们非常不言自明,并且值很容易更改。vendor_ticket_item数组有点复杂。它包含由打印机功能描述的id/值对。id将包含功能中参数的名称,值将包含参数选项中某个记录的名称,或数值等,如功能中所述。

有关模式的详细信息,请查看我的完整解决方案。

{
"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.
    ]
 }
}