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

183
Vistas
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
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