2019-02-05 08:04
浏览 113

将原始数据打印到标签打印机(QRCode) - 使用PHP的ESC / P.

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!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dpylt7626401
    dpylt7626401 2019-02-19 12:25

    Finally i found the solution by myself ;)
    One has to use hex for the parameters to work.
    Like this:
    return chr(27) . "iQ\x03\x02\x00\x00\x00\x00\x02\x00" . $this->dataString . chr(92) . chr(92) . chr(92);

    点赞 评论