zoukankan      html  css  js  c++  java
  • K3cloud 打印例子



    1、选择打印机名称:
    private selectPrinterNameButtonClick(e){
            //参数 0:只返回选中的打印机名称,1:同时返回当前可用打印机列表,100:只返回当前可用的打印机列表
            this.View.AddAction("SelectPrinterExt",0)
    }


    protected override CustomEvents(e){
            //参数0 e.EventArgs:{"Data":"{"Selected":true,"PrinterName":"Doro PDF Writer" }","RetType":0}
            //参数1 e.EventArgs:{"Data":"{"Selected":true,"PrinterName":"Doro PDF Writer" ,"AllPrinterNames":["Microsoft XPS Document Writer","Doro PDF Writer"]}","RetType":1}
            //参数100 e.EventArgs:{"Data":"{"Selected":true ,"AllPrinterNames":["Microsoft XPS Document Writer","Doro PDF Writer"]}","RetType":100}
            var printNameObject =  e.EventArgs;
    }


    2、获取名称后调用打印进行静默打印;

    /// <summary>
    /// 打印
    /// </summary>
    /// <param name="printJobId">打印任务ID</param>
    /// <param name="printType">打印类型</param>
    /// <param name="printer">打印机ID</param>
    public void NoteTemplateOperation(string printJobId, string printType, object printer = null, string printBarName = null)
    {
        JSONObject jsonObj = new JSONObject();
        jsonObj.Put("pageID", this.View.PageId);
        jsonObj.Put("printJobId", printJobId);
        jsonObj.Put("action", printType);

        string action = string.Empty;
        if (printType.EqualsIgnoreCase("preview") || printType.EqualsIgnoreCase("PrintMergePreview"))
        {
            action = JSAction.printPreview;
            jsonObj.Put("printBarName", printBarName);
        }
        else if (printType.EqualsIgnoreCase("print") || printType.EqualsIgnoreCase("PrintMerge"))
        {
            action = JSAction.print;
            jsonObj.Put("printerAddress", printer.IsNullOrEmpty() == true ? string.Empty : Convert.ToString(printer));
        }

        this.View.AddAction(action, jsonObj);
    }
  • 相关阅读:
    python爬取图片
    TensorFlow学习系列(四):minist实例--卷积神经网络
    TensorFlow学习系列(四):minist实例--用简单的神经网络训练和测试
    TensorFlow学习系列(三):实例数据下载和读取
    TensorFlow学习系列(二):入门起步
    TensorFlow学习系列(一):安装调试
    Anaconda安装
    screen的安装和使用
    YII 使用mysql语句查询
    YII 返回值为JSON格式
  • 原文地址:https://www.cnblogs.com/liangyuwen/p/13197173.html
Copyright © 2011-2022 走看看