I am doing a server side coding and wanted to convert the file extension to pdf extension and it should be saved in S3. Any suggestions will be valuable. I am a beginner in this area, so apologies if the question offends anyone.
uploadFiles: (files, bucketName, path) =>{
return new Promise(async function(resolve, reject) {
var doc = new PDFDocument()
var file = files[0];
let filename = file.originalFilename;
var file_path = file.path;
doc.image(file_path, {
fit: [250, 300],
align: 'center',
valign: 'center'
});
//doc.y = 300
//doc.pipe(res)
// console.log('img',img);
var path = 'images/'+ file.originalFilename;
console.log( 'path',path);
var path = await uploadFiles(file, bucketName, path);
resolve(path);
//doc.end()
});
}
};