🔒 Closed Solved

JavaScript:
// Add below your existing event listener
document.getElementById('start-ocr').addEventListener('click', function() {
    var fileSelector = document.getElementById('file-selector');
    if (fileSelector.files.length > 0) {
        var file = fileSelector.files[0];
        Tesseract.createWorker().then(worker => {
            worker.recognize(file).then(function(result) {
                // Get the recognized text from the result
                var text = result.data.text;
                // Set the recognized text as input
                textInput.value = text;
                // Trigger the input event to update counts
                textInput.dispatchEvent(new Event('input'));
                // Terminate the worker
                worker.terminate();
            }).catch(function(error) {
                // Handle any errors that might occur
                console.error(error);
                alert('An error occurred while performing OCR.');
            });
        })
    }
});

walang initialize lods

1702863738470.png

Check mo lang lagi yung error sa console para madebug mo ng ayos
 
JavaScript:
// Add below your existing event listener
document.getElementById('start-ocr').addEventListener('click', function() {
    var fileSelector = document.getElementById('file-selector');
    if (fileSelector.files.length > 0) {
        var file = fileSelector.files[0];
        Tesseract.createWorker().then(worker => {
            worker.recognize(file).then(function(result) {
                // Get the recognized text from the result
                var text = result.data.text;
                // Set the recognized text as input
                textInput.value = text;
                // Trigger the input event to update counts
                textInput.dispatchEvent(new Event('input'));
                // Terminate the worker
                worker.terminate();
            }).catch(function(error) {
                // Handle any errors that might occur
                console.error(error);
                alert('An error occurred while performing OCR.');
            });
        })
    }
});

walang initialize lods

View attachment 2842761

Check mo lang lagi yung error sa console para madebug mo ng ayos
Thank you po yun pala 🤩
 

About this Thread

  • 3
    Replies
  • 568
    Views
  • 2
    Participants
Last reply from:
Ruyi

Trending Topics

Online now

Members online
1,157
Guests online
4,866
Total visitors
6,023

Forum statistics

Threads
2,353,663
Posts
29,380,669
Members
1,081,108
Latest member
Bobeve2311
Back
Top