'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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
