Foreign Investor Legal Compliance Guide (USA)
A high-level guide to key legal considerations for investing in the United States.
This document is for informational purposes only and does not constitute legal or financial advice. Consult with qualified U.S. legal and tax professionals before making any investment decisions. Generated on ${new Date().toLocaleDateString('en-US')}.
`; } async function handlePdfDownload() { document.getElementById('pdf-content').innerHTML = generatePdfHtml(); const { jsPDF } = window.jspdf; const button = document.getElementById('downloadPdfBtn'); button.textContent = 'Generating...'; button.disabled = true; const pdfContainer = document.getElementById('pdf-container'); pdfContainer.classList.remove('invisible'); try { const canvas = await html2canvas(pdfContainer, { scale: 2 }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'p', unit: 'mm', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const imgProps = pdf.getImageProperties(imgData); const pdfHeight = (imgProps.height * pdfWidth) / imgProps.width; pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight); pdf.save('Foreign_Investor_Compliance_Guide.pdf'); } catch (error) { console.error("PDF generation failed:", error); } finally { button.textContent = 'Download Your Guide'; button.disabled = false; pdfContainer.classList.add('invisible'); } } // --- EVENT LISTENERS --- nextBtn.addEventListener('click', () => changeTab(currentTab + 1)); prevBtn.addEventListener('click', () => changeTab(currentTab - 1)); tabButtons.forEach(button => button.addEventListener('click', (e) => changeTab(parseInt(e.target.dataset.tab)))); document.getElementById('downloadPdfBtn').addEventListener('click', handlePdfDownload); document.getElementById('structure-options').addEventListener('click', e => { const card = e.target.closest('.info-card'); if (!card) return; document.querySelectorAll('.info-card').forEach(c => c.classList.remove('selected')); card.classList.add('selected'); document.getElementById('selected-structure').value = card.dataset.value; }); // --- INITIALIZATION --- renderContent(); updateTabDisplay(); });