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

156
Views
¿Cómo puedo almacenar el valor del texto reconocido en este Tesseract.recognize en javascript?

Quiero almacenar el valor del finallext en una variable e imprimirlo en un cuadro de texto, ¿cómo puedo hacerlo? ¿¿¿¿Puede alguien ayudarme con esto????

 Tesseract.recognize( '../uploads/scanned-images/<?php echo $image_name; ?>', 'eng', { logger: m => console.log(m) } ).then(({ data: { text } }) => { var extractedText = text; var finalText = extractedText.replace(/[^0-9A-Za-z]/gi, ''); alert(finalText); })
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede devolver algunas variables en then() como esta.

 const finalText = await Tesseract.recognize( '../uploads/scanned-images/<?php echo $image_name; ?>', 'eng', { logger: m => console.log(m) } ).then(({ data: { text } }) => { let extractedText = text; let finalText = extractedText.replace(/[^0-9A-Za-z]/gi, ''); // alert(finalText); return finalText; }); alert(finalText);

PD : debe usar async function .

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!