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

157
Views
html2canvas corta el desbordamiento de div

Estoy tratando de descargar todo el contenido de un div, incluido el desbordamiento, usando html2canvas, pero la imagen siempre está recortada.

Aquí hay un enlace de violín con código de ejemplo: https://jsfiddle.net/50x2gfne/1/

 function grab() { const captureElement = document.querySelector('#capture') html2canvas(captureElement) .then(canvas => { canvas.style.display = 'none' document.body.appendChild(canvas) return canvas }) .then(canvas => { const image = canvas.toDataURL('image/png').replace('image/png', 'image/octet-stream') const a = document.createElement('a') a.setAttribute('download', 'my-image.png') a.setAttribute('href', image) a.click() canvas.remove() }) capture.style.oveflow = 'scroll' }

Intenté cambiar el ancho del html y el cuerpo a un tamaño más amplio, configurar la ventana gráfica más ancha y cambiar el ancho de la función de lienzo.

También probé el método en el siguiente enlace para manejar el desbordamiento horizontal sin suerte: https://blog.logrocket.com/export-react-components-as-images-html2canvas/

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!