I have a very basic implementation and it doesn't work, I see how electron is opened on the navigation bar, but the callback is not getting executed and the file is not created.
let sourcePdfFilePath = path.resolve(./tmp/${fileObj.originalname});
let outputThumbFilePath = path.resolve(./tmp/${fileObj.originalname.split('.').slice(0, -1).join('.')}${extensions.PNG});
fs.writeFileSync(sourcePdfFilePath, fileObj.buffer, (err) => {
if(err) {
logger.error('Temporal PDF file could not be stored to create the thumb.');
}
});
// At this point the pdf file is getting created
I have a very basic implementation and it doesn't work, I see how electron is opened on the navigation bar, but the callback is not getting executed and the file is not created.
let sourcePdfFilePath = path.resolve(
./tmp/${fileObj.originalname}
); let outputThumbFilePath = path.resolve(./tmp/${fileObj.originalname.split('.').slice(0, -1).join('.')}${extensions.PNG}
);fs.writeFileSync(sourcePdfFilePath, fileObj.buffer, (err) => { if(err) { logger.error('Temporal PDF file could not be stored to create the thumb.'); } }); // At this point the pdf file is getting created
require('pdf-to-png')({ input: sourcePdfFilePath, output: outputThumbFilePath }, function() {console.log('Convertion completed.........!!!!!!')});