Hedge Fund Compliance Checklist
(${completedItemsCount} of ${totalItemsCount} items completed)
Detailed Breakdown:
| Category | Compliance Item | Status |
|---|---|---|
| ${category.name} | ` : ''}${item.name} | ${item.completed ? 'Complete' : 'Incomplete'} |
Hedge Fund Compliance Checklist Report
Generated on: ${new Date().toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })}
${resultsOutputDiv.innerHTML}
`;
// Temporarily hide the main tool container to avoid layout issues during PDF generation
complianceChecklistContainer.style.display = 'none';
html2pdf().from(pdfContent).set({
margin: [20, 20, 20, 20], // Top, Left, Bottom, Right
filename: 'Hedge_Fund_Compliance_Checklist.pdf',
image: { type: 'jpeg', quality: 0.98 },
html2canvas: { scale: 2, logging: true, dpi: 192, letterRendering: true },
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
}).save().then(() => {
// Restore visibility of the main tool container after PDF generation is complete
complianceChecklistContainer.style.display = 'flex';
pdfContent.remove(); // Clean up temporary element
}).catch(error => {
console.error("Error generating PDF:", error);
showCustomModal('PDF Generation Error', 'There was an issue generating the PDF. Please try again.');
complianceChecklistContainer.style.display = 'flex';
pdfContent.remove();
});
}
// --- Event Listeners ---
if (nextButton) {
nextButton.addEventListener('click', handleNextButtonClick);
}
if (prevButton) {
prevButton.addEventListener('click', handlePrevButtonClick);
}
// Custom modal close button
if (modalCloseButton) {
modalCloseButton.addEventListener('click', hideCustomModal);
}
// Close modal if clicking outside (on overlay)
if (customModalOverlay) {
customModalOverlay.addEventListener('click', (e) => {
if (e.target === customModalOverlay) {
hideCustomModal();
}
});
}
// --- Initial Setup ---
initializeTabs(); // Populate tabs and content on load
showTab(0); // Show the first tab on load
});