i am trying to print a page I designed with react primeflex to a pdf with jspdf. I see the pdf output, but it has poor image quality. The code output is given below.
const inputRef = useRef(null);
const printDocument = () => {
html2canvas(inputRef.current).then((canvas) => {
const imgData = canvas.toDataURL("image/png");
const pdf = new jsPDF();
pdf.addImage(imgData, "JPEG", 10, 0);
pdf.save("download.pdf");
})
}