How to read QR codes
Estimated Reading Time: 1 Minutes
In KB article #320, we showed how to generate a QR code in your COBOL program.
In this article, we'll show you how to call the attached program to generate or read a QR code.
Like the earlier article, you must first download 2 jar files, and put them in your CLASSPATH.
Here's the link to the ZXing libraries (Zebra Crossing).
isQR.cbl is the program that either writes or reads a QR. An example of the code you might use to call isQR is included in CALLISQR.cbl.
When you call isQR, you'll need to pass these 5 variables:
- opCode:Set opCode to 0 to generate a QR code, 1 to read a QR code
- imgPath: The path and name of the QR code. Include extension .jpeg, .gif, .bmp, or .png
- qrText: The QR code's text value
- imgWidth: Width in pixes of QR Code when generating (0 when read)
- imgHeight: Height in pixes of QR Code when generating (0 when read)