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;