Online Alternative Dispute Resolution System Online Alternative Dispute Resolution System Manage and resolve disputes efficiently and collaboratively. Case Dashboard Manage Case Generate Report Initiate New Case Initiate New Case Case Details Case Title / Subject Parties Involved Claim Amount ($) Case Status Initiated In Negotiation Awaiting Evidence Resolved Closed Initial Statement of Issue Communication Log Add Final Resolution Save Case Select a Case to Report Select a case to generate a report. Download Report as PDF Previous Next No communications logged.'} Final Resolution ${caseData.resolution || 'Not yet resolved.'} `; container.innerHTML = reportHTML; pdfBtnSection.classList.remove('hidden'); }); async function downloadPdf() { const pdfLoader = document.getElementById('pdf-loader'); const downloadBtn = document.getElementById('downloadPdfBtn'); const content = document.getElementById('pdf-content'); if(!content) return; pdfLoader.classList.remove('hidden'); downloadBtn.disabled = true; try { const canvas = await html2canvas(content, { scale: 2 }); const imgData = canvas.toDataURL('image/png'); const { jsPDF } = window.jspdf; const pdf = new jsPDF('p', 'pt', 'letter'); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = pdf.internal.pageSize.getHeight(); const margin = 40; const imgWidth = pdfWidth - margin * 2; const imgHeight = (canvas.height * imgWidth) / canvas.width; let heightLeft = imgHeight; let position = margin; pdf.addImage(imgData, 'PNG', margin, position, imgWidth, imgHeight); heightLeft -= (pdfHeight - margin * 2); while (heightLeft > 0) { position = margin - (pdfHeight - margin*2); // Re-calculate position for new page pdf.addPage(); pdf.addImage(imgData, 'PNG', margin, position, imgWidth, imgHeight); heightLeft -= pdfHeight; } pdf.save('ADR-Case-Report.pdf'); } catch(error) { console.error("PDF Generation Error:", error); } finally { pdfLoader.classList.add('hidden'); downloadBtn.disabled = false; } } document.getElementById('downloadPdfBtn').addEventListener('click', downloadPdf); // Initial setup showTab(0); renderDashboard(); lucide.createIcons(); });