How to Extract Aadhaar Card Information

how to extract aadhaar card info

What is Aadhaar card

Aadhaar is a 12-digit unique identity number that can be obtained voluntarily by residents or passport holders of India, based on their biometric and demographic data. The data is collected by the Unique Identification Authority of India (UIDAI), a statutory authority established in January 2009 by the government of India. Aadhaar is the world’s largest biometric ID system.

The Aadhaar card consists of key information on the person such as the name, gender, and date of birth in plain text as well as a QR code. UIDAI has introduced a new Secure QR Code which contains demographic details of a resident like name, address, date of birth, gender and masked Aadhaar number as well as a photograph of the Aadhaar number holder.

The QR code, which contains very critical information regarding the cardholder, is used by the government, banks and other service agencies. With the vast adoption of Aadhaar ID, it covers 90% of the population in India, which is approximately 1.2 billion. The speed and accuracy of the QR code decoder are paramount.

How to build an Aadhaar card reader

There are two ways to build an application that automatically extracts the biological and geological information about the cardholder: 

  • Using OCR technology to recognize the characters printed on the card
  • Use barcode recognition technology to decode the QR Code and then parse it into human-readable formats

Generally speaking, the latter is more accurate and cost-effective than the former. The encoded QRcode also provides more information than the human-readable characters printed on the card. Below we will take a look at two applications using barcode technology.

web addhaar card application

Building a web Aadhaar card reader application

If you are building a web application follow the steps below:

  1. Scan the Aadhaar card or the letter containing the QRCode using a scanning device with Dynamic Web TWAIN SDK
  2. Use Dynamsoft Barcode Reader SDK to decode the QRCode and extract the cardholder’s information.

Benefits:

  • Scan multiple Aadhaar cards and read multiple QR Code at once
  • Scan multiple pages and identify which page of the stack is an Aadhaar card and save as PDF if found.
  • Save scanned Aadhaar card as PDF, JPG or other formats 
  • Easily upload Aadhaar card files to the server or database.
aadhaar mobile application

Building a mobile Aadhaar card reader application

All you need is Dynamsoft Barcode Reader SDK to capture and decode the card. You can load existing images into the app to scan or read the QR code in real-time.  

Benefits: 

  • No extra scanning device needed, you just need a mobile device
  • Works offline so it’s very portable

Sample Code

Check out the sample code below on how to implement an Aadhaar card web application where you can upload an image and reads the information from the QR code.

<!DOCTYPE html>
<html>

<body>
    <script src="https://code.jquery.com/jquery-3.4.1.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@7.2.3-v2/dist/dbr.js"
        data-productKeys="PRODUCT-KEY"></script>
    <input id="uploadImage" type="file" accept="image/bmp,image/jpeg,image/png,image/gif">
    <p id="results"></p>

    <script>
        document.getElementById('uploadImage').addEventListener('change', async function () {
            $("#results").empty();
            var files = this.files;
            let reader = await Dynamsoft.BarcodeReader.createInstance();
            let results = await reader.decode(files[0]);
            if (results.length == 0) {
                $("#results").append('No barcode detected!');
                return;
            }
            for (let result of results) {
                console.log(result.barcodeText);
                try {
                    xmlDoc = $.parseXML(result.barcodeText),

                        $(xmlDoc).each(function (i, obj) {
                            console.log(i);
                            console.log(obj.documentElement.nodeName);

                            $data = $(xmlDoc).find(obj.documentElement.nodeName);
                            $data.each(function () {

                                $.each(this.attributes, function (i, attrib) {
                                    var name = attrib.name;
                                    var value = attrib.value;

                                    console.log(name);
                                    console.log(value);

                                    info = '<div>' + name + ': ' + value + '</div>';
                                    $("#results").append(info);
                                });
                            });
                        });
                } catch (error) {
                    $("#results").append(error.message);
                }
            }
        });
    </script>

</body>

</html>

Get sample code on Github

Take the Next Step

To see how Dynamsoft Barcode Reader performs with your specific barcode scenarios, please check out our online demo, or start your free 30-day trial.

Try our Free Online Demo

Start your Free 30-Day Trial



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe Newsletter

Subscribe to our mailing list to get the monthly update.

Subscribename@email.com