Legal Document Analyzer

Legal Document Analyzer

Paste your legal text below to get an AI-powered summary and clause identification.

No specific clauses were automatically identified.

'; } obligationsOutput.innerHTML = ''; if (analysis.obligations && analysis.obligations.length > 0) { analysis.obligations.forEach(obligation => { obligationsOutput.innerHTML += `
  • ${obligation}
  • `; }); } else { obligationsOutput.innerHTML = '
  • No specific obligations were automatically identified.
  • '; } resultsSection.classList.remove('hidden'); lucide.createIcons(); // Re-render icons in the report } function showError(message) { errorMessage.textContent = message; errorMessage.classList.remove('hidden'); } // --- PDF Download Logic --- downloadPdfBtn.addEventListener('click', () => { const { jsPDF } = window.jspdf; const content = document.getElementById('pdf-content'); html2canvas(content, { scale: 2, backgroundColor: '#ffffff' }).then(canvas => { const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'portrait', unit: 'pt', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = pdf.internal.pageSize.getHeight(); const canvasWidth = canvas.width; const canvasHeight = canvas.height; const ratio = canvasWidth / canvasHeight; const widthInPdf = pdfWidth - 80; // Margin let heightInPdf = widthInPdf / ratio; let position = 40; pdf.addImage(imgData, 'PNG', 40, position, widthInPdf, heightInPdf); let heightLeft = heightInPdf - (pdfHeight - 80); while (heightLeft > 0) { position = position - (pdfHeight - 80); pdf.addPage(); pdf.addImage(imgData, 'PNG', 40, position, widthInPdf, heightInPdf); heightLeft -= (pdfHeight - 80); } pdf.save('Legal-Document-Analysis.pdf'); }); }); // Initialize Lucide icons lucide.createIcons(); });
    Scroll to Top