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

213
Vistas
fs.stat error on converting pdf to Image using npm pdf-image package

I am trying to convert a pdf to image in frontend using javascript using this https://www.npmjs.com/package/pdf-image package.

export const Convertpdf2img = async() => {
    var pdfImage = new PDFImage('./dummy.pdf');
    pdfImage.convertPage(0).then(function (imagePath) {
        // 0-th page (first page) of the slide.pdf is available as slide-0.png
          const ans = fs.existsSync("./dummy.png") // => true
    },function(err){
        console.log(err);
    });
}

The error I am getting is this - TypeError: fs.stat is not a function

My dummy file is in the same folder where this function is written.

about 4 years ago · Juan Pablo Isaza
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