The following code works fine and generating PDF on the front end and downloading it successfully. But I am confused about how to send it to the server in API using fetch or Axios. Couldn't find any documentation regarding this to send it though API and save it as PDF from server-side into s3.
const input = document.getElementById('divToPrint');
html2canvas(input)
.then((canvas) => {
const imgData = canvas.toDataURL('image/png');
const pdf = new jsPDF();
pdf.addImage(imgData, 'PNG', 0, 0);
pdf.save("download.pdf");
});
})