【问题标题】:Google Cloud Printing and Capabilities PPD谷歌云打印和功能 PPD
【发布时间】:2013-07-15 14:06:48
【问题描述】:

我们通过 Google 的云打印服务取得了一些成功。但是想知道在提交要打印的作业时是否有人知道有关功能参数的信息,以及如何创建和使用这种我认为是 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"
      }
     ]
    }

【问题讨论】:

    标签: php printing cloud


    【解决方案1】:

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

    模式详情请看我的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.
        ]
     }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-14
      • 2012-09-23
      • 2016-04-15
      • 2014-07-21
      • 2015-04-23
      • 2019-05-14
      • 2020-09-03
      • 2021-10-12
      相关资源
      最近更新 更多