International Legal Compliance Cross-Reference Tool

International Legal Compliance Cross-Reference Tool

Compliance Cross-Reference Report

Please select countries and topics in the Data Configuration tab.

${data.details}

`; } else { tableHTML += `Data not available`; } }); tableHTML += ``; }); tableHTML += ``; container.innerHTML = tableHTML; }; // --- PDF Generation --- const downloadPDF = () => { const { jsPDF } = window.jspdf; const content = document.getElementById('pdf-content'); const title = document.getElementById('dashboard-title').textContent; html2canvas(content, { scale: 2, windowWidth: content.scrollWidth }).then(canvas => { const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF('l', 'mm', 'a4'); // landscape const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = pdf.internal.pageSize.getHeight(); const ratio = canvas.width / canvas.height; let imgWidth = pdfWidth - 20; let imgHeight = imgWidth / ratio; if (imgHeight > pdfHeight - 20) { imgHeight = pdfHeight - 20; imgWidth = imgHeight * ratio; } pdf.addImage(imgData, 'PNG', 10, 10, imgWidth, imgHeight); pdf.save(`${title.replace(/\s/g, '_')}.pdf`); }); }; // --- Init & Event Listeners --- const setSampleData = () => { // Pre-select some countries and topics ['USA', 'United Kingdom', 'Germany'].forEach(c => { const el = document.getElementById(`country-${c}`); if(el) el.checked = true; }); ['Data Privacy', 'Anti-Bribery & Corruption'].forEach(t => { const el = document.getElementById(`topic-${t}`); if(el) el.checked = true; }); }; const setupCheckboxHelpers = (type) => { document.getElementById(`select-all-${type}`).addEventListener('click', () => { document.querySelectorAll(`#${type}-config input[type="checkbox"]`).forEach(cb => cb.checked = true); }); document.getElementById(`deselect-all-${type}`).addEventListener('click', () => { document.querySelectorAll(`#${type}-config input[type="checkbox"]`).forEach(cb => cb.checked = false); }); }; document.getElementById('update-dashboard-btn').addEventListener('click', () => { calculateAndDisplayResults(); switchTab('dashboard'); }); document.getElementById('download-pdf-btn').addEventListener('click', downloadPDF); // Initial Load buildConfigForm(); setSampleData(); setupCheckboxHelpers('countries'); setupCheckboxHelpers('topics'); calculateAndDisplayResults(); switchTab('dashboard'); });
Scroll to Top