Encoding data into two dimensional barcodes can be done directly with Ubuntu, as the default repositories provide tools which accept a text file as input and outputs a png datamatrix or QR Code.

Pause Hi-Tech encoded in QR CodePause Hi-Tech in QR Code

Here is the iec16022 and qrencode command-line tools usage, in order to quickly encode bits of text into a 2D barcode.


sudo apt-get install iec16022
iec16022 -f PNG -i input.txt -o output.png
mogrify -scale 300x300 output.png

QR Code

sudo apt-get install qrencode
cat input.txt | qrencode -s 10 -o output.png
Pause Hi-Tech encoded in datamatrixEncoded in Datamatrix Code

Note: the -s 10 defines the size (in pixels) of a dot.

Creating datamatrix and QR codes with Linux has never been so easy!

Note that you can decode QR codes using the libdecodeqr-examples Ubuntu package which includes a C++ app along with its source code.