johnnywang1994 / jsPDF-html2canvas

A combine usage with jsPDF & html2canvas, which translating html content to PDF file.
MIT License
74 stars 9 forks source link

not separating divs into separate pages #15

Open osimuka opened 3 years ago

osimuka commented 3 years ago

Using React 17

const pdfRef = createRef();

<div id="page" ref={pdfRef}>
    <div className="page page-1">
      {reportHeader()}
    </div>
    <div className="page page-2">
      {reportContent()}
    </div>
    <div className="page page-3">
      {reportSummary()}
    </div>
    <div className="page page-4">
      {reportMain()}
    </div>
    <div className="page page-5">
      {reportConclusion()}
    </div>
</div>

I can't get it to separate using the custom separation protocol

Any help?

johnnywang1994 commented 2 years ago

hi, need to confirm how and where did you call the html2pdf function?