codecamp

printImage

打印自定义数据(打印图片)

printImage({params}, callback(ret, err))

params

base64:

  • 类型:字符串
  • 描述:(必填项)图片base64编码,注意去掉头信息。

示例代码

var gprinter = api.require('xGprinter');
gprinter.printImage({
    base64 : 'iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAYAAABS3GwHAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOxAAADsQBlSsOGwAAB8tJREFUeF7tm4Fu4zYQRE/9/39O4wMMqK5skqMhrR29AMXhLtrV7hu+WE7S7ef34w8fELgpgX9uujdrQ+AvAQTgINyaAALcOn6WRwDOwK0JbPs3wdu23RoGy9+DwP77PrwC3CNztnxDAAE4GrcmgAC3jp/lEYAzcGsCzTfB/KD41uej/PJH39jhTXD5WFnARYBHIBdJ+pQkgAAlY2NoFwEEcJGkT0kCCFAyNoZ2EUAAF0n6lCSAACVjY2gXAQRwkaRPSQIIUDI2hnYRQAAXSfqUJIAAJWNjaBcBBHCRpE9JAghQMjaGdhFAABdJ+pQkgAAlY2NoFwEEcJGkT0kCCFAyNoZ2EUAAF0n6lCSAACVjY2gXAQRwkaRPSQIIUDI2hnYRQAAXSfqUJIAAJWNjaBcBBHCRpE9JAghQMjaGdhFAABdJ+pQkgAAlY2NoFwEEcJGkT0kCCFAyNoZ2EUAAF0n6lCSAACVjY2gXAQRwkaRPSQIIUDI2hnYRQAAXSfqUJIAAJWNjaBcBBHCRpE9JAghQMjaGdhFAABdJ+pQkgAAlY2NoFwEEcJGkT0kCCFAyNoZ2EUAAF0n6lCSAACVjY2gXAQRwkaRPSQIIUDI2hnYRQAAXSfqUJIAAJWNjaBcBBHCRpE9JAghQMjaGdhFAABdJ+pQkgAAlY2NoFwEEcJGkT0kCCFAyNoZ2EUAAF0n6lCSAACVjY2gXAQRwkaRPSQIIUDI2hnYRQAAXSfqUJIAAJWNjaBcBBHCRpE9JAghQMjaGdhFAABdJ+pQkgAAlY2NoFwEEcJGkT0kCCLAwtm3b/rz+t/D23OqAAAIsOhaPg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D8JuEjRragR4BNK4URVCAAFCgmQNjQACaNyoCiGAACFBsoZGAAE0blSFEECAkCBZQyOAABo3qkIIIEBIkKyhEUAAjRtVIQQQICRI1tAIIIDGjaoQAggQEiRraAQQQONGVQgBBAgJkjU0AgigcaMqhAAChATJGhoBBNC4URVCAAFCgmQNjQACaNyoCiGAACFBsoZGAAE0blSFEECAkCBZQyOAABo3qkIIIEBIkKyhEUAAjRtVIQQQICRI1tAIIIDGjaoQAggQEiRraAQQQONGVQgBBAgJkjU0AgigcaMqhAAChATJGhoBBNC4URVCAAFCgmQNjQACaNyoCiGAACFBsoZGAAE0blSFEECAkCBZQyOAABo3qkIIIEBIkKyhEUAAjRtVIQQQICRI1tAIIIDGjaoQAggQEiRraAQQQONGVQgBBAgJkjU0AgigcaMqhAAChATJGhoBBNC4URVCAAFCgmQNjQACaNyoCiGAACFBsoZGAAE0blSFEECAkCBZQyOAABo3qkIIIEBIkKyhEUAAjRtVIQQQICRI1tAIIIDGjaoQAggQEiRraAQQQONGVQgBBAgJkjU0AgigcaMqhAAChATJGhoBBNC4URVCAAFCgmQNjcD28/vxLN22TetCFQQKEdgd+T+8AhQKjlH9BBDAz5SOhQggQKGwGNVPAAH8TOlYiMB/3gQXmptRIWAhwCuABSNNqhJAgKrJMbeFAAJYMNKkKgEEqJocc1sI/AttM9RW4CyLLgAAAABJRU5ErkJggg=='
});
printMultipleText
getStatus
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

端API

设备访问

ipAddress

wifiSSID

smartConfigCheyw

无标题文章

前端框架

云API

开发工具

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }