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

296
Views
How can I set content height to fit a single pdf page?

I am using jspdf's html() method to convert an HTML string of an invitation to pdf.

The problem is that I don't know how to set the content height to fit in one pdf page, cause the generated pdf get split if the height is bigger than the pdf height and it's not looking good for an invitation.

Here is my code:

const doc = new jspdf('p', 'pt', 'a4');
let docWidth = doc.internal.pageSize.getWidth();

const htmlString = row.content;
await doc.html(htmlString, {
  callback: function(doc) {
    doc.save('file.pdf');
  },

  autoPaging: 'text',
  margin: [0, 0, 0, 0],
  width: docWidth,
  windowWidth: 1000,

})
over 4 years ago · Santiago Trujillo
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!