pan-aadhaar-ocr


PAN and Aadhaar OCR Extractor

A Node.js package for extracting PAN and Aadhaar card numbers from scanned images using Optical Character Recognition (OCR).

Learn more on Dev.to.

Installation

You can install this package using npm:

npm install pan-aadhaar-ocr

Or, if you prefer using yarn:

yarn add pan-aadhaar-ocr

Usage

const {extractCardDetails} = require('pan-aadhaar-ocr');

const imagePath = 'path/to/your/image.jpg'; // Pass path to your PAN/Aadhaar image
const cardType = 'PAN'; // Card type can either be `PAN` or `AADHAAR`

extractCardDetails(imagePath, cardType)
    .then((extractedDetails) => {
        console.log(`PAN Number: ${extractedDetails.Number}`);
    })
    .catch((err) => {
        console.error(err);
    });

You can also use async-await:

try {
    const extractedDetails = await extractCardDetails(imagePath, cardType);
    console.log(extractedDetails);
} catch (err) {
    console.error('Something went wrong while extracting card details');
}

Supported Card Types

PAN

PAN (Permanent Account Number) is a unique ten-character alphanumeric identifier issued by the Income Tax Department of India. It is widely used for financial and tax-related purposes.

AADHAAR

Aadhaar is a 12-digit unique identity number issued by the Unique Identification Authority of India (UIDAI). It is used for various government and private sector services and is a crucial identification document in India.

PAN & Aadhaar Validation

For KYC processes, use the following API to validate PAN and AADHAAR:

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

License

This module is authored by Vinit Shahdeo and licensed under the MIT License.


Made with ❤️ by @vinitshahdeo for India 🇮🇳