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

211
Views
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
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!