How to Create Bar Code and QR Code in Ubuntu

To Create Bar Code and QR Code in Ubuntu 15.10

In this tutorial we will learn how to install and create Barcode and QR code in Ubuntu 15.10

To install Barcode

Utilise the following command to install the aptitude package.

root@user1-linuhelp:~# apt-get install aptitude
Reading package lists... Done
Building dependency tree       
Reading state information... Done
.
.
.
Setting up aptitude (0.7.3-1ubuntu1.1) ...
update-alternatives: using /usr/bin/aptitude-curses to provide /usr/bin/aptitude (aptitude) in auto mode
Processing triggers for libc-bin (2.21-0ubuntu4) ...

Execute the following command to search the barcode package.

root@user1-linuhelp:~# aptitude search barcode
p   barcode                                         - Utility and library for barcode generation               
p   barcode:i386                                    - Utility and library for barcode generation               
p   barcode-dbg                                     - Utility and library for barcode generation (debug)       
p   barcode-dbg:i386                                - Utility and library for barcode generation (debug)       
p   golang-barcode-dev                              - Barcode creation lib for golang                          
p   libbarcode-code128-perl                         - Perl library to generate CODE 128 bar codes              
p   libbarcode-zbar-perl                            - bar code scanner and decoder (Perl bindings)             
p   libbarcode-zbar-perl:i386                       - bar code scanner and decoder (Perl bindings)             
p   libgd-barcode-perl                              - Perl module to create barcode images (GD::Barcode)       
p   libpdf-reuse-barcode-perl                       - Create barcodes for PDF documents with PDF::Reuse        
p   libpostscriptbarcode                            - Barcode Writer in Pure PostScript

Run the following command to install the barcode package.

root@user1-linuhelp:~# apt-get install barcode
Reading package lists... Done
Building dependency tree       
Reading state information... Done
.
.
.
Processing triggers for install-info (6.0.0.dfsg.1-3) ...
Setting up barcode (0.98+debian-9.1) ...

To create a barcode

Create the barcode by using the following command.

root@user1-linuhelp:~# barcode -b " mycode2792"  -o first.ps

Open the created barcode file as shown below.

root@user1-linuhelp:~# display first.ps



To install QR code package

Run the following command to install QR code package.

root@user1-linuhelp:/home/user1/Desktop# apt-get install qrencode
Reading package lists... Done
Building dependency tree       
Reading state information... Done
.
.
.
Setting up libqrencode3:amd64 (3.4.3-1) ...
Setting up qrencode (3.4.3-1) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...

To Create the QR code

Run the following command to create the QR code as shown below.

root@user1-linuhelp:/home/user1/Desktop# qrencode " MYCODExyz007"  -o file.ps

Open the generated QR code file by using the following command.

root@user1-linuhelp:/home/user1/Desktop# display file.ps

Comment
parthiban
Aug 27 2018
you can check it's man page use the command man barcode
Add a comment
FAQ
Q
Can I use QR Codes in foreign countries?
A
For matters related to intellectual property rights, please refer to the FAQ "QR Code's intellectual property right."
Q
What is a UPC barcode?
A
You are probably familiar with the barcodes you see on most packaged products. These barcodes are in the UPC-A code format. It is 12 digits long.
Q
How does a barcode work?
A
A barcode essentially is a way to encode information in a visual pattern that a machine can read. The combination of black and white bars (elements) represents different text characters which follows a set algorithm for that barcode type. If you change the sequence of elements you get different text.
Q
How many characters can fit into a barcode?
A
Depending on the specific barcode type, 1D barcodes can have from 20-25 characters while 2D codes go up to 2,000 characters. The main practical concern is that as you increase the amount of information in the barcode the bigger it will become. This is especially the case with 1D barcodes and in use most people encode 8-15 characters.
Q
How to make the qr code appear on screen?
A
Use "Display" command along with file name to show the preview of the QR code