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

92
Views
¿Por qué mi JsPdf empuja todos los elementos hacia la izquierda y hace que su ancho sea pequeño?

Cuando uso jsPDF para generar un pdf de mi sitio, todos los elementos se empujan hacia la izquierda y son tan delgados como pueden ser. Intenté establecer el ancho tanto en las opciones de pdf.html() como en las opciones de html2canvas en el interior.

 const doc = new jsPDF({ orientation: "p", format: "legal", unit: "px", hotfixes: ["px_scaling"] }); const elementHandler = { '#ignorePDF': function (element) { return false; } } const body = document.getElementsByClassName("content")[0]; doc.html(body.parentElement, { autoPaging: 'text', width: 1000, html2canvas: { width: 1000, windowWidth: 1000 }, callback: async function (doc) { doc.setLineWidth(1000); doc.save("test.pdf") }, elementHandler: elementHandler });

Esto genera un pdf que se ve así:

pdf desordenado

Gracias de antemano.

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