'Content in Html2PDF result exceed a4 size

I'm trying to create a feature that allows user to download pdf. I developed it using html2pdf.js + react. I manage to create the pdf content in tag but the content such as table, paragraph, etc. exceed the size of a4 paper, how can I fix this ?

here's my code:

{/*Create Invoice Preview */}
<Preview id={'invoice-template'} >
    <h1>UD-SUPERJAYA </h1>
    <p className="fontBold">Invoice #0178832</p>
    <hr />

    <Row>
        <Col lg={6}>
            <p className="fontBold">Invoiced to</p>
            <p>Mdsada</p>
            <p>Jalan Kalimantan No 29, Samarinda Kota, Kalimantan </p>
            <p>Indonesia</p>
        </Col>

        <Col lg={6} className="text-end">
            <p className="fontBold">Pay to</p>
            <p>PT dsada</p> <br />

            <p>NPWP: 94321310</p>
            <p>No PKP: P330/W1PJ.131/9403129/KR0233129/99310</p>
            <p>Tgl Pengukuhan: 17 Desember 2013</p>

            <br/>
            <p>Alamat:</p>
            <p>Jalan Kalimantan No 29, US Kota, Jawa</p>
            <p>Telp: 08322 3232 3212 </p>

        </Col>
    </Row>
    
    <br />

    <Row>
        <Col lg={6}>
            <p className="fontBold">Invoiced Date</p>
            <p>16/10/2020</p>
        </Col>

        <Col lg={6} className="text-end">
            <p className="fontBold">Payment Method</p>
            <p>OVO</p>
        </Col>
    </Row>
</Preview>

<Row>
   <Col lg={12} className="text-end fontMedium">
     <Button onClick={()=>print('Invoice', 'invoice-template')} className="invoicebutton">Submit</Button>
    </Col>
</Row>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source