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

131
Views
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
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!