From 04806c6d53dbd66fa0bc324bdc3d47ab28e961c5 Mon Sep 17 00:00:00 2001 From: "pramod.mahajan" Date: Sat, 8 Nov 2025 15:34:59 +0530 Subject: [PATCH] fixed error - building image --- src/components/UserSubscription/Invoice.jsx | 33 +-------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/src/components/UserSubscription/Invoice.jsx b/src/components/UserSubscription/Invoice.jsx index 2583a451..c6e377ec 100644 --- a/src/components/UserSubscription/Invoice.jsx +++ b/src/components/UserSubscription/Invoice.jsx @@ -68,38 +68,7 @@ const Invoice = ({ invoiceData, currencySymbol }) => { }; const downloadPDF = async () => { - setIsGenerating(true); - - try { - const invoice = invoiceRef.current; - const canvas = await html2canvas(invoice, { - scale: 2, - useCORS: true, - logging: false, - backgroundColor: "#ffffff", - }); - - const imgData = canvas.toDataURL("image/png"); - const pdf = new jsPDF({ - orientation: "portrait", - unit: "mm", - format: "a4", - }); - - const imgWidth = 210; - const pageHeight = 297; - const imgHeight = (canvas.height * imgWidth) / canvas.width; - - pdf.addImage(imgData, "PNG", 0, 0, imgWidth, imgHeight); - - const paymentId = data.razorpayPaymentDetails.paymentId; - pdf.save(`Invoice_${paymentId}.pdf`); - } catch (error) { - console.error("Error generating PDF:", error); - alert("Failed to generate PDF. Please try again."); - } finally { - setIsGenerating(false); - } + alert("Under the woking"); }; const payment = data.razorpayPaymentDetails;