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

178
Views
jsPDF showing different color when downloading normally but it's fine in inspect mode

enter image description here

I have an invoice page here in my angular application on which am trying to use html2canvas and jsPdf to convert the html into pdf and download. When am downloading the right side of the pdf is showing with that grey color, but when am inspecting the page and going to device toolbar then while downloading it has no problem at all. Please help, any help would be appreciated. Here is my code below :

  public downloadInvoice(){
    let invoice = document.getElementById('invoice-detail');
    html2canvas(invoice).then((canvas)=>{
      console.log(canvas);
      let imgData = canvas.toDataURL('image/png');
      let doc = new jsPDF('p', 'mm', 'a4');
      let imgHeight = canvas.height * 208 / canvas.width;
      console.log(imgHeight);
      
      doc.addImage(imgData, 'PNG', 0, 0, 208, imgHeight)
      doc.save('invoice.pdf');
    })
  }
<div class="card invoice-preview-card" id="invoice-detail">

That's my container for the entire invoice section.

about 4 years ago · Santiago Trujillo
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!