region:us
<script src="https://cdn.rawgit.com/naptha/tesseract.js/1.0.10/dist/tesseract.js"></script>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Tesseract.js OCR Example</title>
</head>
<body>

<input type="file" accept="image/*" onchange="handleFile(this.files)">
<div id="result"></div>

<script src="https://cdn.rawgit.com/naptha/tesseract.js/1.0.10/dist/tesseract.js"></script>
<script>
    function handleFile(files) {
        const file = files[0];

        if (file) {
            const reader = new FileReader();

            reader.onload = function (e) {
                const image = new Image();
                image.src = e.target.result;

                image.onload = function () {
                    // Perform OCR using Tesseract.js
                    Tesseract.recognize(
                        image,
                        'eng', // Specify the language (e.g., English)
                        { logger: info => console.log(info) } // Optional logger for debugging
                    ).then(({ data: { text } }) => {
                        // Display the recognized text
                        document.getElementById('result').innerText = text;
                    });
                };
            };

            reader.readAsDataURL(file);
        }
    }
</script>

</body>
</html>
