Estoy tratando de convertir un documento html a pdf usando javascript, pero la calidad es significativamente más baja de lo que debería ser (el texto está borroso, los colores no son puros,...) aunque se muestra bien en mi navegador web.
aquí está la función de generador de pdf que estoy usando:
public convertToPDF() { let domElement = this.pdfTable.nativeElement as HTMLElement; html2canvas(domElement).then(canvas => { // Few necessary setting options var imgWidth = 210; var pageHeight = 750; 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, 'JPG', 0, position, imgWidth, imgHeight) pdf.save('new-file.pdf'); // Generated PDF }); }