Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

113
Vistas
Preserving indentation with Tesseract.js library

I am using tessearct.js library in my angular code. I want to preserve the white spaces, the indentation as it is. How to do it? Currently I am using this piece of code to do it.

async doOCR {
    const worker = createWorker({
      logger: m => console.log(m),
    });
    
    await worker.load();
    await worker.loadLanguage('eng');
    await worker.initialize('eng');
    const value = await worker.recognize(this.selectedFile);
  }

I am looking a method to do it on client side only, that's why not using its python library.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can give it a try after version (3.04), they have added the preserve_interword_spaces`. You can try this and check if this works:


async doOCR {
    const worker = createWorker({
      logger: m => console.log(m),
    });
    
    await worker.load();
    await worker.loadLanguage('eng');
    await worker.initialize('eng');
  // there is no proper documentation, but they have added this flag
  // to run it as a command
    await worker.setParameters({
       preserve_interword_spaces: 1,
    });

    const value = await worker.recognize(this.selectedFile);
  }
 
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda