Remote Work Compliance Policy Generator
Create a comprehensive remote work policy tailored to your company's needs.
Company & Policy Details
Eligibility & Expectations
Equipment & Workspace
$
Security & Confidentiality
Your Generated Remote Work Policy
Company-Provided Equipment: ${companyName} will provide the following equipment to support remote work:
- ${companyEquip || "
- No company-provided equipment specified. "}
Home Office Stipend: ${stipendText}
4. Security & Confidentiality
Protecting company data is a top priority. Remote employees must comply with the following security requirements:
- ${securityReqs || "
- No security requirements specified. "}
All employees are bound by the company's confidentiality agreement, regardless of their work location. Sensitive information must not be left unsecured or accessible to non-employees.
`; const policyOutputEl = document.getElementById('policy-output-content'); if (policyOutputEl) { policyOutputEl.innerHTML = policyHTML; } }; const handleDownloadPdf = async () => { const { jsPDF } = window.jspdf; const content = document.getElementById('policy-output-content'); if (!content) { console.error("PDF content area not found."); return; } const originalButtonText = downloadPdfBtn.innerHTML; downloadPdfBtn.innerHTML = 'Generating...'; downloadPdfBtn.disabled = true; try { const canvas = await html2canvas(content, { scale: 2 }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF('p', 'mm', 'a4'); const pdfWidth = pdf.internal.pageSize.getWidth(); const imgProps = pdf.getImageProperties(imgData); const imgHeight = (imgProps.height * pdfWidth) / imgProps.width; let heightLeft = imgHeight; let position = 15; pdf.addImage(imgData, 'PNG', 10, position, pdfWidth - 20, imgHeight); heightLeft -= pdf.internal.pageSize.getHeight(); while (heightLeft > 0) { position = heightLeft - imgHeight; pdf.addPage(); pdf.addImage(imgData, 'PNG', 10, position, pdfWidth - 20, imgHeight); heightLeft -= pdf.internal.pageSize.getHeight(); } pdf.save('Remote_Work_Policy.pdf'); } catch (error) { console.error("Error generating PDF:", error); // No alert per spec } finally { downloadPdfBtn.innerHTML = originalButtonText; downloadPdfBtn.disabled = false; } }; // Event Listeners tabButtons.forEach((btn, index) => { btn.addEventListener('click', () => switchTab(index + 1)); }); prevBtn.addEventListener('click', () => switchTab(currentTab - 1)); nextBtn.addEventListener('click', () => switchTab(currentTab + 1)); downloadPdfBtn.addEventListener('click', handleDownloadPdf); // Initial setup updateNavButtons(); });