Search code examples
phpprintingqr-codeescpos

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!


Solution

  • 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);