How to create your own QR Codes in Ubuntu, offline

QR Codes have made entering text, especially on mobile devices very easy. This comes in very handy when you have to either search for something, or the text you want to enter is quite lengthy and random, e.g., WiFi keys for one.

A quick Google search on qr code generator results in a lot hits, but mainly for online generators. Like me, there will be people who will be skeptical about sharing sensitive data online just to generate a QR Code. I was looking for an offline generator and found one by the name of qrencode.

Installation

qrencode if small and nifty and does the job perfectly. As is common with most of FOSS, there are multiple ways to install qrencode.

1. Automated Install – Desktop

Fire up Ubuntu Software Center and search for qrencode. Once found, install and start using (Usage instructions below).

2. Automated Install – Command Line

sudo apt-get install qrencode

and thats it. Follow the on screen instructions to install and start using it right away.

3. Manual Install

There is also an option to install qrencode from source. Click qrencode anywhere on this page to go their website and download the source. Instructions to compile and install are available there on the website.

Usage Instructions

Usage of qrencode is quite simple. Here is an example:

qrencode -o path/to/file.png '[text/url/whatever_you_want_to_encode]'

This will generate an output file named file.png at the location you provided and will contain the scanable QR Code with the information you provided. Thats it!

For those of you who want more information, here is the help output from qrencode:

qrencode version 3.1.1
Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi
Usage: qrencode [OPTION]... [STRING]
Encode input data in a QR Code and save as a PNG image.

-h display this message.
--help display the usage of long options.
-o FILENAME write PNG image to FILENAME. If '-' is specified, the result
will be output to standard output. If -S is given, structured
symbols are written to FILENAME-01.png, FILENAME-02.png, ...;
if specified, remove a trailing '.png' from FILENAME.
-s NUMBER specify the size of dot (pixel). (default=3)
-l {LMQH} specify error collectin level from L (lowest) to H (highest).
(default=L)
-v NUMBER specify the version of the symbol. (default=auto)
-m NUMBER specify the width of margin. (default=4)
-S make structured symbols. Version must be specified.
-k assume that the input text contains kanji (shift-jis).
-c encode lower-case alphabet characters in 8-bit mode. (default)
-i ignore case distinctions and use only upper-case characters.
-8 encode entire data in 8-bit mode. -k, -c and -i will be ignored.
-V display the version number and copyrights of the qrencode.
[STRING] input data. If it is not specified, data will be taken from
standard input.

There are plenty of mobile applications available to scan the QR Codes using phone’s camera. E.g., Android users can use Barcode Scanner (my favorite).

Update:

iPhone: QRafter (Thanks to my brother for pointing this out)

2 comments to How to create your own QR Codes in Ubuntu, offline

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>