Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
Tesseract.js doesn't recognize Arabic language

I'm using tesseract.js ORC library to read what is written on an image and write it in console or on a text file so I found this library and it's working find with English word or characters but when I tried to read what is written on the image in Arabic language it doesn't work so this is the image that I'm trying to read

enter image description here

and this is my code :-

Head Tag:-

<script src='https://unpkg.com/tesseract.js@v2.1.0/dist/tesseract.min.js'</script>

Body Tag:-

    <script>
        Tesseract.recognize(
        'image.png',
        'ara',
  { logger: m => console.log(m) }
).then(({ data: { text } }) => {

})
</script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need to handle the result inside the .then() block.

Here's a working example :

<!DOCTYPE html>
<meta charset="utf-8">
<title> OCR TEST </title>
<script src="https://unpkg.com/tesseract.js@v2.1.0/dist/tesseract.min.js"></script>
<output id="result">Processing...</output>
<script>
  const output = document.querySelector('output#result');
  Tesseract.recognize(
    'https://i.imgur.com/mdzmK4w.png', 'ara'
  ).then(result => {
    output.value = result.data.text;
  }).catch(err => {
    output.value = 'Processing Failed';
    console.log(err);
  });
</script>

It can take some time to process, especially on the first load because the WASM module and OCR training data will be fetched in the background first. You can see this happening in the Network tab of your Dev Tools.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!