Legal Notice Generator

Legal Notice Generator

Create a formal legal notice for dispatch.

Sender & Recipient Information

Notice Details

Review & Download Legal Notice

Review the formatted legal notice below. To make changes, use the 'Previous' button or click on the tabs above.

Your formatted legal notice will appear here.

This notice is sent without prejudice to any of our rights and contentions in law and equity.

Sincerely,

${senderName}

`; outputContainer.innerHTML = html; }; // --- PDF Download --- const downloadPDF = async () => { if (typeof window.jspdf === 'undefined' || typeof window.html2canvas === 'undefined') { console.error("jsPDF or html2canvas is not loaded."); return; } const { jsPDF } = window.jspdf; const content = document.getElementById('pdf-output-container'); downloadPdfBtn.textContent = 'Generating...'; downloadPdfBtn.disabled = true; try { const pdf = new jsPDF({ orientation: 'portrait', unit: 'pt', format: 'letter' }); await pdf.html(content, { margin: [72, 72, 72, 72], // Standard 1-inch margins autoPaging: 'text', width: 468, // Letter width (612pt) - margins (72pt * 2) windowWidth: 700, html2canvas: { scale: 0.8, useCORS: true } }); const fileName = `legal_notice_to_${getText('recipientName', 'recipient')}.pdf`.toLowerCase().replace(/[^a-z0-9]/gi, '_'); pdf.save(fileName); } catch (error) { console.error("Error generating PDF:", error); } finally { downloadPdfBtn.textContent = 'Download as PDF'; downloadPdfBtn.disabled = false; } }; // --- Event Listeners --- tabs.forEach(tab => tab.addEventListener('click', () => showTab(parseInt(tab.dataset.tab, 10)))); nextBtn.addEventListener('click', () => { if (currentTab < totalTabs) showTab(currentTab + 1); }); prevBtn.addEventListener('click', () => { if (currentTab > 1) showTab(currentTab - 1); }); if(downloadPdfBtn) downloadPdfBtn.addEventListener('click', downloadPDF); // Set default date const dateInput = document.getElementById('noticeDate'); if(dateInput) { dateInput.valueAsDate = new Date(); } // --- Initial Setup --- showTab(1); });
Scroll to Top