`;
};
pdfRenderContainer.innerHTML = buildPdfHtml();
html2canvas(pdfRenderContainer, { scale: 2, useCORS: true })
.then(canvas => {
const { jsPDF } = window.jspdf;
const pdf = new jsPDF({ orientation: 'portrait', unit: 'px', format: 'a4' });
const imgData = canvas.toDataURL('image/png');
const pdfWidth = pdf.internal.pageSize.getWidth();
const pdfHeight = pdf.internal.pageSize.getHeight();
const imgWidth = canvas.width;
const imgHeight = canvas.height;
const ratio = imgWidth / imgHeight;
let finalWidth = pdfWidth - 40;
let finalHeight = finalWidth / ratio;
pdf.addImage(imgData, 'PNG', 20, 20, finalWidth, finalHeight);
pdf.save('My_Study_Groups.pdf');
});
};
// --- Initial Load ---
switchToTab('dashboard');
});