Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!