php - Print raw data to label printer (QRCode) - ESC/P with PHP
问题描述
I'm trying to print QRCode-labels on a Brother QL580 label printer directly with PHP (Version 5.6).
The function i'm calling to print a QRCode returns:
return chr(27) . 'iQ32000020' . $this->dataString . chr(92) . chr(92) . chr(92);
This works only in part. The QRCode is printed correctly (the $dataString
is included) but the preceding 8 parameters seem to be ignored.
I want to increase the cell size of the QRCode (first parameter) but changing the value does not take effect.
The documentation says:
Any help would be apreciated!
解决方案
最后我自己找到了解决方案;)
必须使用十六进制才能使参数起作用。
像这样:
return chr(27) . "iQ\x03\x02\x00\x00\x00\x00\x02\x00" . $this->dataString . chr(92) . chr(92) . chr(92);
推荐阅读
- node.js - NPM CI 和 Bluebird 承诺警告
- excel - 循环多次执行相同的代码
- php - Laravel 5.7 资源路径未定义
- vue.js - Vuex:状态管理。从状态或服务器获取数据哪个更好?
- assertj - AssertJ + 验证 subList 中返回的项目包含字符串,该字符串将出现在任何列表项目中
- java - Jasper 使用 Java 中的 jsonql 数据源填充报告
- java - 使用模板或泛型动态命名函数
- vba - Outlook 附件检查
- mysql - 如何将 LIKE 运算符与二进制有序时间 UUID 一起使用
- webpack - 使用 webpack 优化未引用的图片(img-loader)