score:0

 processPdf = () => {
        const foo = document.getElementById('canvas');
    
        html2canvas(foo)
            .then((canvas) => {
                var width = pdf.internal.pageSize.getWidth();
                var height = pdf.internal.pageSize.getHeight();
                const handledImage = canvas.toDataURL('image/png');
                const pdf = new jsPDF('p', 'px', 'a4');
                pdf.addImage(handledImage, 'JPEG', 0, 0, width, height);
                pdf.save("test.pdf");
            });
    };

Related Query

More Query from same tag