Automated Tax Filing for Investment Portfolios
Tax Filing Summary
Estimated Tax Owed: $${taxOwed.toFixed(2)}
`; document.getElementById('reportContent').innerHTML = summaryHtml + tableHtml; document.getElementById('taxReport').style.display = 'block'; document.getElementById('taxReport').scrollIntoView({behavior: 'smooth'}); } function downloadTaxReportPDF() { const report = document.getElementById('taxReport'); if(!report.innerText.trim()) { alert('Please calculate tax before downloading the report.'); return; } html2canvas(report).then(canvas => { const imgData = canvas.toDataURL('image/png'); const { jsPDF } = window.jspdf; const pdf = new jsPDF('p', 'pt', 'a4'); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = (canvas.height * pdfWidth) / canvas.width; pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight); pdf.save("Investment_Tax_Filing_Report.pdf"); }); } // Initialize with one transaction row addTransaction();