Traté de convertir html a pdf y descargarlo con este código debajo. funciona bien con la conversión adecuada de HTML div a pdf, conversión y descarga, pero para convertir lleva demasiado tiempo y descargar el pdf.
public convetToPDF() { var data = document.getElementById('contentToConvert'); html2canvas(data).then(canvas => { // Few necessary setting options var imgWidth = 208; var pageHeight = 295; var imgHeight = canvas.height * imgWidth / canvas.width; var heightLeft = imgHeight; const contentDataURL = canvas.toDataURL('image/png') let pdf = new jspdf('p', 'mm', 'a4'); // A4 size page of PDF var position = 0; pdf.addImage(contentDataURL, 'PNG', 0, position, imgWidth, imgHeight) pdf.save('new-file.pdf'); // Generated PDF }); }```