I have an array link image, I user library pdfkit to convert image to PDF and then upload PDF on S3.
Here code convert image to PDF
imageFiles.forEach((image, index) => {
if(index === 0) {
doc.image(image, {fit: A4_SIZE});
} else {
doc.addPage(image, {fit: A4_SIZE});
}
});
// upload S3
....................................
But I have an issue is convert is not done yet then function upload s3 has run