Skip to Content

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:

  1. opCode:Set opCode to 0 to generate a QR code, 1 to read a QR code
  2. imgPath: The path and name of the QR code. Include extension .jpeg, .gif, .bmp, or .png
  3. qrText: The QR code's text value
  4. imgWidth: Width in pixes of QR Code when generating (0 when read)
  5. imgHeight: Height in pixes of QR Code when generating (0 when read)
How to read QR codes
  • Attached Files
  • callisqr.cbl (2.92 KB) 223
  • isqr.cbl (5.44 KB) 22