Sustainable Real Estate Investment Analyzer
Property Value After ${years} Years: $${finalPropertyValue.toFixed(2)}
Total Estimated Return: $${totalReturn.toFixed(2)}
`; document.getElementById('result').innerHTML = html; } async function downloadPDF() { const { jsPDF } = window.jspdf; const resultDiv = document.getElementById('result'); if (!resultDiv || resultDiv.innerHTML.trim() === '') { alert("Please analyze investment before downloading."); return; } const doc = new jsPDF(); let y = 10; doc.setFontSize(14); doc.text("Sustainable Real Estate Investment Report", 10, y); y += 10; const lines = resultDiv.innerText.split('\n'); lines.forEach(line => { doc.text(line, 10, y); y += 8; }); doc.save("Real-Estate-Investment-Report.pdf"); }