I have table in html. I want to use jsPDF library to make a pdf. But my table oversized a4 page size. How to fit table in a4 page.
My react code:
export default function OfferPDF({offer, paramsId}) {
const generatePDF = () => {
const pdfSize = 'a4';
const doc = new jsPDF('p', 'pt', pdfSize);
doc.setFont('Ubuntu', 'normal');
doc.html(document.getElementById('pdf-content'), {
callback: function (pdf) {
pdf.save(`${offer.offers_year}/${offer.offers_no}.pdf`);
}
});
}
return (
<div id="pdf-content">
<table className="table table-bordered">
<tbody>
<tr>
<td>Müşteri</td>
<td>{offer.trade_name}</td>
<td>Bilgi</td>
<td>{offer.information}</td>
</tr>
...
</tbody>
</table>
<button onClick={generatePDF}>Pdf</button>
</div>
);
}

