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

163
Views
JSPDF y html2canvas exportan como PNG en lugar de PDF

Tengo un proyecto para exportar div a PDF usando JSPDF y html2canvas

y necesito personalizar el código para exportar el div a PNG, no a PDF

el código

 $('#print').click(function (e) { e.preventDefault(); let HTML_Width = $(".report").width(); let HTML_Height = $(".report").height(); let top_left_margin = 1; let canvas_image_width = HTML_Width; let canvas_image_height = HTML_Height; html2canvas($(".report")[0]).then(function (canvas) { let imgData = canvas.toDataURL("image/jpeg", 1.0); let pdf = new jsPDF('l', 'pt', [HTML_Width, HTML_Height]); pdf.addImage(imgData, 'PNG', 0, 0, HTML_Width, HTML_Height); pdf.save("Report.pdf"); $(".html-content").hide(); }); });
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!