Website Disclaimer Generator
Generate a standard disclaimer for your website.
Basic Information
Select Disclaimer Clauses
Ready to Generate
You have provided the necessary details. Click below to generate your website disclaimer.
Disclaimer Preview
${c.content}
`).join('')} `; document.getElementById('output-display').innerHTML = previewHTML; document.getElementById('output-title').textContent = `Disclaimer for ${data.websiteName}`; elements.formContainer.style.display = 'none'; document.getElementById('tab-container').style.display = 'none'; elements.navButtons.style.display = 'none'; elements.outputSection.classList.remove('hidden'); } function downloadPDF() { const { jsPDF } = window.jspdf; if (!elements.downloadBtn) return; elements.downloadBtn.textContent = 'Generating Document...'; elements.downloadBtn.disabled = true; try { const data = getFormData(); const clauses = generateClauses(data); const doc = new jsPDF({ orientation: 'p', unit: 'mm', format: 'a4' }); const margin = 20; const pageWidth = doc.internal.pageSize.getWidth(); const pageHeight = doc.internal.pageSize.getHeight(); let yPos = margin; let pageNum = 1; const addHeader = () => { doc.setFont('Helvetica', 'bold'); doc.setFontSize(18); doc.text(`Disclaimer for ${data.websiteName}`, pageWidth / 2, yPos, { align: 'center' }); yPos += 10; doc.setFont('Helvetica', 'normal'); doc.setFontSize(10); doc.text(`Last Updated: ${data.lastUpdated}`, pageWidth / 2, yPos, { align: 'center' }); yPos += 15; }; const addFooter = () => { doc.setFontSize(9); doc.text(`Page ${pageNum}`, pageWidth / 2, pageHeight - 10, { align: 'center' }); }; const checkPageBreak = (neededHeight) => { if (yPos + neededHeight > pageHeight - 15) { addFooter(); doc.addPage(); pageNum++; yPos = margin; addFooter(); } }; addHeader(); addFooter(); clauses.forEach(clause => { doc.setFont('Helvetica', 'bold'); doc.setFontSize(12); const titleLines = doc.splitTextToSize(clause.title, pageWidth - margin * 2); checkPageBreak(titleLines.length * 6); // More space for bold title doc.text(titleLines, margin, yPos); yPos += titleLines.length * 5 + 3; doc.setFont('Helvetica', 'normal'); doc.setFontSize(10); const contentLines = doc.splitTextToSize(clause.content, pageWidth - margin * 2); checkPageBreak(contentLines.length * 5 + 8); // Standard line height doc.text(contentLines, margin, yPos); yPos += contentLines.length * 5 + 8; }); doc.save(`Website_Disclaimer_${data.websiteName.replace(/\s/g, '_')}.pdf`); } catch (error) { console.error("Error generating PDF:", error); alert("An error occurred while generating the PDF. Please try again."); } finally { elements.downloadBtn.textContent = 'Download as Formal Document (PDF)'; elements.downloadBtn.disabled = false; } } showTab(currentTab); });