storeAsImage(pageToConvertAsImage). then((resolve) => {
console.log("Page 1 is now converted as image");
return resolve;
}).catch(err=>{
console.log("error",err)
})`
When i try to execute this code, its showing this warning.
'(Use node --trace-warnings ... to show where the warning was created)
(node:24620) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 data listeners added to [ReadStream]. Use emitter.setMaxListeners() to increase limit'
`const pdf2pic = require("pdf2pic"); const options = { saveFilename: "8.21_POLICE.FSO", savePath: "./uploads", format: "jpg", width: 2550, height: 1250, density: 150 };
const storeAsImage = pdf2pic.fromPath("./uploads/8.21_POLICE.FSO.pdf", options).bulk; const pageToConvertAsImage = -1;
storeAsImage(pageToConvertAsImage). then((resolve) => { console.log("Page 1 is now converted as image"); return resolve; }).catch(err=>{ console.log("error",err) })`
When i try to execute this code, its showing this warning.
'(Use
node --trace-warnings ...
to show where the warning was created) (node:24620) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 data listeners added to [ReadStream]. Use emitter.setMaxListeners() to increase limit'I followed this solution in https://stackoverflow.com/questions/8313628/node-js-request-how-to-emitter-setmaxlisteners to hide this warning. What's the best way to solve this issue? In my case i may have to deal with PDFs with 100-200 pages.