This is the 15th day of my participation in the November Gwen Challenge. Check out the event details: The last Gwen Challenge 2021.
Fans welfare: search # small program: iOS reverse, pay attention to the public number: iOS reverse welfare [digging gold booklet 50% discount code]
There is only one left, valid until 23:59 on November 30.
preface
QRCode printing process under ESC command consists of four steps. There are four commands corresponding to the following four steps:
- Set QRCode size; (Can be omitted)
2. Set the level of error correction; (Generally do not need to set, ignore)Copy the code
- The text information corresponding to QRCode is stored in the printer cache; (Must have)
4. Run the print QRCode commandCopy the code
I Bluetooth print receipts
1.1 Setting the Size
[command addQRCodeSizewithpL:(content.length+3) withpH:0x00 withcn:0 withyfn:0 withn:0x9];
1.2 Store the text information corresponding to QRCode in the printer cache; (Must have)
In this example, it is the hexadecimal ASCII code corresponding to the Gprinter (red part). QRCode data is "Gprinter", a total of 8 characters, so K = 8.Copy the code
From k = (pL + pH × 256) -3, pL = 11(green) and pH = 0(blue) can be calculated.
[command addQRCodeSavewithpL:(content.length+3) withpH:0 withcn:0x31 withyfn:0x50 withm:0x30 withData:[content dataUsingEncoding:NSUTF8StringEncoding]];
Copy the code
1.3 Sending the Print command
[command addQRCodePrintwithpL:0 withpH:0 withcn:0 withyfn:0 withm:0];
1.4 Setting the error correction level
see also
More content please pay attention to # applets: iOS Reverse, only to present valuable information for you, focus on mobile technology research field; For more services and consultation, please pay attention to the public number: iOS Reverse.
IOS TscCommand [Template for printing price tags and template for printing receipts, automatic connection to the recently used printer] (for Jiabo GP-2120TU model)
Kunnan.blog.csdn.net/article/det…