Federal Contractor Compliance Tracker

Federal Contractor Compliance Tracker

Audit your adherence to key U.S. federal contracting regulations.

Welcome to your Compliance Dashboard!

Navigate the tabs to complete the audit. Your results will update here in real-time.

Step 1 of 5

Congratulations! No non-compliant items were found based on your answers.

'; } container.innerHTML = html; } function generateFullReportForPdf() { let html = '

Detailed Audit Answers

'; Object.keys(auditQuestions).forEach(key => { const category = auditQuestions[key]; const data = complianceData[key]; html += `

${category.title}

`; html += ''; category.questions.forEach((q, index) => { const answer = data.answers[index] || 'Unanswered'; let statusClass = 'text-gray-500'; if (answer === 'yes') statusClass = 'text-green-600 font-bold'; if (answer === 'no') statusClass = 'text-red-600 font-bold'; html += ``; }); html += '
QuestionResponse
${q}${answer.toUpperCase()}
'; }); return html; } async function generatePdf() { const { jsPDF } = window.jspdf; const pdfContent = document.getElementById('pdf-content'); if (!pdfContent) { console.error("PDF content area not found."); return; } const nonCompliantSummaryContainer = document.getElementById('non-compliant-summary'); if (nonCompliantSummaryContainer) { nonCompliantSummaryContainer.innerHTML += generateFullReportForPdf(); } try { const canvas = await html2canvas(pdfContent, { scale: 2, useCORS: true }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'portrait', unit: 'pt', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = pdf.internal.pageSize.getHeight(); const imgProps = pdf.getImageProperties(imgData); const imgWidth = pdfWidth - 40; const imgHeight = (imgProps.height * imgWidth) / imgProps.width; let heightLeft = imgHeight; let position = 20; pdf.addImage(imgData, 'PNG', 20, position, imgWidth, imgHeight); heightLeft -= (pdfHeight - 40); while (heightLeft > 0) { position = heightLeft - imgHeight + 20; // Re-calculate position for subsequent pages pdf.addPage(); pdf.addImage(imgData, 'PNG', 20, position, imgWidth, imgHeight); heightLeft -= (pdfHeight - 40); } pdf.save('Federal_Contractor_Compliance_Report.pdf'); } catch (error) { console.error('Error generating PDF:', error); alert('An error occurred while generating the PDF. Please try again.'); } finally { // Restore the original summary view after PDF generation generateNonCompliantSummary(); } } // --- START THE APP --- initializeTool(); });
Scroll to Top