Creating and reading QR codes
Variety
Qrencode lets you encode any text, including URLs. You only need to use single quotes if blanks and non-standard characters appear in the text:
$ qrencode -o lpm.png http://www.linuxpromagazine.com
All modern QR code readers recognize that this is a web address and will offer to open it in the browser.
Getting an QR-encoded address automatically to enter a smartphone owner's address book is more difficult. In this case, you need to enter your address and some additional, cryptic information:
$ qrencode -o address.png 'BEGIN:VCARD VERSION:4.0 FN: N:Schuermann;Tim;;; ADR:;;Putzbrunner Str. 71;Munich;;81739; END:VCARD'
Typing this is not exactly easy, so to make life easier, you might prefer a QR code generator with a graphical user interface, such as QtQR [2].
QtQR
As the name suggests, QtQR is based on Qt. The tool relies on Python and the python-qrtools
library. You can simply install the program via the package manager on Ubuntu. For other distributions, you will find the source code and RPM and DEB packages on the project's download page [3].
The main window in QtQR is quite simple: Top left in the selection you can set what data you want to store in the QR code. For an address, choose Contact Information (PhoneBook). Depending on the type of information, QtQR displays appropriate fields (Figure 4).
![](/var/linux_magazin/storage/images/linux-magazine.com/issues/2013/145/qr-code-generators/figure-4/584085-1-eng-US/Figure-4_large.png)
As you fill out the fields, the program creates the corresponding QR code on the right. You can resize the code at top right. Pixel Size lets you set the number of pixels per square dot the QR code uses, whereas Margin Size lets you specify the size of the margin. Error Correction lets you define the correction level. Once you have set all parameters, save the code as a PNG file by clicking the Save QRCode button.
Portable QR-Code Generator
If QtQR's capabilities do not meet your needs, you can try Portable QR-Code Generator [4]. It also encodes geographical coordinates and WiFi access data, which can be useful if you want to offer guests quick access to WiFi as a hotel or coffee shop operator, for example.
Because Portable QR-Code Generator is written in Java, you must first install a Java run-time environment via the package manager. On Ubuntu, launch the Software Center and find the OpenJDK Java 7 runtime; on openSUSE 12.3, the matching package goes by the name java-1_7_0-openjdk.
The ZIP archive of the portable QR code generator is available from the project's Downloads page (to download, click on the Herunterladen link under the .zip
entry). Unzip the file on your hard drive, open a terminal window, change to the directory with the extracted files, and run the command:
$ java -jar QRCodeGen.jar
The main window appears, and a small preview window (Figure 5) shows you the QR code. In the main window, look at the top edge first. Depending on the data you want to store in the code, click on the appropriate tab; that is, to save a URL, open the URL tab, and for an address, use VCard v4.
![](/var/linux_magazin/storage/images/linux-magazine.com/issues/2013/145/qr-code-generators/figure-5/584088-1-eng-US/Figure-5_large.png)
In the selected tab, the program displays appropriate fields. For an address, you will see more tabs that group the information, but you only need to fill out the required fields. If you do not want to specify a phone number, simply ignore the Telephone tab. If the address is already in a vCard file, you can import it by clicking Read VCard.
Once you have entered the data to encode, click on Generate. The results appear in the preview window. Plain text (in the Text tab) and geographic coordinates (in the Geo URI tab) are exceptions; the preview shows the code during entry.
You can define the size of the QR codes, as well as the error correction level at the bottom left under QR Code options section. In contrast to the previously featured tools, the Portable QR code generator allows you to specify the dimensions for the final image.
If you set Requested size (pixel) to 400, the resulting QR code image is 400 screen pixels wide. However, if you want to specify the size of each dot in the code, set Mode to Module size, then in Module size (pixel) define the number of pixels to form a dot. Additionally, you can select a specific Character encoding (see the "Character Encoding" box).
Character Encoding
QR codes contain no information about the encoding method used. Therefore, programs or apps simply try to guess. If this does not work, non-standard characters like umlauts are illegible. Because current apps assume UTF-8 encoding by default, you probably want to use this setting in the Character encoding drop-down box in Portable QR-Code Generator.
To be on the safe side (e.g., because you have business partners in several countries), you should avoid non-standard characters and model your input on the ISO 8859-1 standard [5]. For more on the topic of character encoding, check out the Wikipedia entry on character encoding [6].
To the right, in the QR Code details panel, you will see some statistics that reveal, among other things, how many bytes of payload (Data byes) the QR code currently displayed contains. To check the text that the Portable QR code generator actually dumped into the QR code, look at the bottom of the window; the details are in the Data field.
You can copy the generated QR code to the clipboard (Edit | Copy QR Code to clipboard) or save a PNG format image file with File | Save As.
« Previous 1 2 3 4 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.