Consumer Protection Case Study Database

Consumer Protection Case Study Database

Explore landmark consumer protection cases in the United States.

${caseItem.ruling}

Impact:

${caseItem.impact}

Settlement/Outcome:

${caseItem.settlement}

`; modal.classList.remove('hidden'); setTimeout(() => modalContent.classList.remove('scale-95'), 10); } function closeModal() { modalContent.classList.add('scale-95'); setTimeout(() => modal.classList.add('hidden'), 300); currentCaseId = null; } // --- PDF GENERATION --- function generatePdf() { if (currentCaseId === null) return; const caseItem = caseData.find(c => c.id === currentCaseId); if (!caseItem) return; const { jsPDF } = window.jspdf; const pdf = new jsPDF({ orientation: 'portrait', unit: 'pt', format: 'a4' }); const margin = 60; const usableWidth = pdf.internal.pageSize.getWidth() - (2 * margin); let cursorY = margin; pdf.setFont('Helvetica', 'bold'); pdf.setFontSize(18); pdf.text(caseItem.title, margin, cursorY); cursorY += 25; pdf.setFont('Helvetica', 'normal'); pdf.setFontSize(12); pdf.setTextColor(100); pdf.text(`${caseItem.category} - Ruled in ${caseItem.year}`, margin, cursorY); cursorY += 30; const addSection = (title, body) => { if (cursorY > pdf.internal.pageSize.getHeight() - 100) { pdf.addPage(); cursorY = margin; } pdf.setFont('Helvetica', 'bold'); pdf.setFontSize(14); pdf.text(title, margin, cursorY); cursorY += 20; pdf.setFont('Helvetica', 'normal'); pdf.setFontSize(11); pdf.setTextColor(50); const lines = pdf.splitTextToSize(body, usableWidth); pdf.text(lines, margin, cursorY); cursorY += (lines.length * 14) + 20; }; addSection('Case Background', caseItem.background); addSection('Ruling & Settlement', caseItem.ruling); addSection('Impact & Significance', caseItem.impact); addSection('Settlement/Outcome', caseItem.settlement); pdf.save(`${caseItem.title.replace(/\s/g, '_')}_Case_Study.pdf`); } // --- START THE APP --- initializeTool(); });
Scroll to Top