Smart Spending Budget Tool 🚀
💰 My Income
Income Log:
- No income logged yet.
🎯 My Savings Goals
My Goals:
- No goals set yet.
💸 Log My Spending
My Recent Spending:
- No spending logged yet.
📊 My Budget Dashboard
Total Income Logged: $0.00
Total Spent: $0.00
Money Left: $0.00
🏆 Savings Goals Progress:
- No goals to show progress for.
🛒 Spending Breakdown (by Category):
- No spending to break down yet.
💡 Smart Spending Tip!
Track every dollar! Small spends add up quickly.
No spending logged.
`; // } html += `Keep up the great budgeting! 🎉
`; pdfContentElement.innerHTML = html; document.body.appendChild(pdfContentElement); html2canvas(pdfContentElement, { scale: 1.5, useCORS: true }).then(canvas => { const imgData = canvas.toDataURL('image/png'); const pdfWidth = pdf.internal.pageSize.getWidth(); const pageHeight = pdf.internal.pageSize.getHeight(); const imgHeight = canvas.height * pdfWidth / canvas.width; let heightLeft = imgHeight; let position = 10; // Margin pdf.addImage(imgData, 'PNG', 10, position, pdfWidth - 20, imgHeight); heightLeft -= (pageHeight - 20); while (heightLeft > 0) { position = heightLeft - imgHeight - 10; pdf.addPage(); pdf.addImage(imgData, 'PNG', 10, position, pdfWidth - 20, imgHeight); heightLeft -= (pageHeight - 20); } pdf.save('My_Smart_Budget.pdf'); document.body.removeChild(pdfContentElement); }).catch(error => { console.error("Error generating PDF:", error); alert("Could not generate PDF. See console for details."); if(document.body.contains(pdfContentElement)) document.body.removeChild(pdfContentElement); }); }