首页 > 解决方案 > 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:

ESC/P QRCode documentation

Any help would be apreciated!

标签: phpprintingqr-codeescpos

解决方案


最后我自己找到了解决方案;)
必须使用十六进制才能使参数起作用。
像这样:
return chr(27) . "iQ\x03\x02\x00\x00\x00\x00\x02\x00" . $this->dataString . chr(92) . chr(92) . chr(92);


推荐阅读