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

132
Vistas
Content Is Not fitting in jsPDF

I am using JsPDf to convert html dom element to pdf but afterg generating PDf. The size of the PDF is adding extra space and make it smaller. Please Check the link to get more details.

  const _generatePdf = ()=>{
    // var [width , height] = size
    var page_el = document.getElementById("doc")
    var width = page_el.clientWidth* (96/72)
    var height = page_el.clientHeight * (96/72)

    // console.log(page_el.offsetWidth*(96/72), width)
    var doc = new jsPDF({
      orientation:"l",
      unit:"pt",
      format:[height, width],
    })
    console.log(doc.internal.pageSize.getWidth(), width)
    console.log(doc.internal.pageSize.getHeight(), height)
    
    doc.html(document.querySelector("#page"),{
      callback:function(pdf){
        // console.log(pdf)
        pdf.save("mypdf.pdf")
      }, 
      html2canvas:{
        scale:1
      } 

    })
  }

Result I am Getting

Result I want

about 4 years ago · Juan Pablo Isaza
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