Workplace Compliance Training Module Generator

Workplace Compliance Training Module Generator

Create customized training materials for your team in minutes.

Step 1: Select Training Topic

Step 2: Customize Content Modules

Step 3: Add Company Specifics

For more detailed information, please review the full policy document available here: ${policyLink}

`; } pdfOutput.innerHTML = moduleHTML; resultsContainer.classList.remove('hidden'); resultsContainer.scrollIntoView({ behavior: 'smooth' }); }); document.getElementById('download-pdf-btn').addEventListener('click', () => { const { jsPDF } = window.jspdf; const pdfContent = document.getElementById('pdf-output'); if (!pdfContent) return; html2canvas(pdfContent, { scale: 2, useCORS: true }).then(canvas => { const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'portrait', unit: 'pt', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const margin = 40; const contentWidth = pdfWidth - margin * 2; const imgProps = pdf.getImageProperties(imgData); const contentHeight = (imgProps.height * contentWidth) / imgProps.width; const pageHeight = pdf.internal.pageSize.getHeight() - margin * 2; let heightLeft = contentHeight; let position = margin; pdf.addImage(imgData, 'PNG', margin, position, contentWidth, contentHeight); heightLeft -= pageHeight; while (heightLeft > 0) { position = heightLeft - contentHeight + margin; // negative pdf.addPage(); pdf.addImage(imgData, 'PNG', margin, position, contentWidth, contentHeight); heightLeft -= pageHeight; } pdf.save(`${trainingTopicSelect.value}_Training_Module.pdf`); }).catch(err => { console.error("Error generating PDF:", err); }); }); populateSections(); // Initial call });
Scroll to Top