How can I generate QR codes from COBOL?
Estimated Reading Time: 1 MinutesQR codes can be generated as bitmap files using the ZXing (Zebra Crossing) barcode scanning library.
All the file types supported by the W$BITMAP routine can be used.
Here are the steps to compile and run the sample COBOL program (QRSAMPLE.cbl) which will generate a png file representing the QR code, show this png on video and allow you to print it.
- Download the latest jar of 'core' and 'javase' from https://repo1.maven.org/maven2/com/google/zxing/
At the moment this article is written, the latest jars are core-3.4.1.jar and javase-3.4.1.jar - Copy the two jars to the 'jars' directory of the isCOBOL SDK
- Copy QRSAMPLE.cbl to a directory, open the isCOBOL Shell and change to that directory
- Compile with the command:
iscc QRSAMPLE.cbl
- Run with the command:
iscrun QRSAMPLE
If you need help please let our support team know.
Click here to view the COBOL source.