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

165
Views
Spliting the generated PDF from jsPDF to a certain div

I hope everyone is healthy and having a nice vacation. I am trying to create PDFs from html using using jsPDF. My framework is ReactJS. I have something like

<Container>
  <div className="div1">...</div>
  <div className="div2">...</div>
  <div className="div3">...</div>
  <div className="div4">...</div>
</Container>

the code I am using for the jsPDF is:

const generatePDF = () => {
    const doc = new jsPDF({
      orientation: "p",
      unit: "pt",
      format: "a4",
      putOnlyUsedFonts: false,
    });
    doc.html(document.querySelector("Container"), {
      callback: function (pdf) {
        pdf.save(
          `pdfName.pdf`
        );
      },
      margin: [40, 40, 60, 20],
      html2canvas: {
        scale: 0.8, 
        width: 1000, 
      },
    });
  };

Is there a way to split the break the page into Page 1 upd to div with class=2 and Page 2 divs 3 and 4?

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!