Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

154
Vistas
Convert html page to pdf without degrading the quality

i'm trying to convert a html document to a pdf using javascript but the quality is significally lower than it should be ( text is blurry, colors are not pure ,... ) even though it's displaying fine in my web browser.

here is the pdf generator function i'm using :

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
  });
}
about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda