Mutual NDA (Non-Disclosure Agreement) Generator

Mutual NDA Generator

Create a customized Mutual Non-Disclosure Agreement for your business dealings.

Disclosing Parties

Party One

Party Two

Name:

Title:

${p2Name}

By:

Name:

Title:

`; const outputContainer = document.getElementById('nda-output-content'); if(outputContainer) outputContainer.innerHTML = ndaHTML; }; const handleDownloadPdf = async () => { const { jsPDF } = window.jspdf; const content = document.getElementById('nda-output-content'); if (!content) return; const originalButtonText = downloadPdfBtn.innerHTML; downloadPdfBtn.innerHTML = 'Generating...'; downloadPdfBtn.disabled = true; try { const canvas = await html2canvas(content, { scale: 2, useCORS: true, backgroundColor: '#ffffff' }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF('p', 'mm', 'a4'); const pdfWidth = pdf.internal.pageSize.getWidth(); const margin = 15; const contentWidth = pdfWidth - (margin * 2); const imgProps = pdf.getImageProperties(imgData); const imgHeight = (imgProps.height * contentWidth) / imgProps.width; let heightLeft = imgHeight; let position = margin; pdf.addImage(imgData, 'PNG', margin, position, contentWidth, imgHeight); heightLeft -= (pdf.internal.pageSize.getHeight() - margin * 2); while (heightLeft > 0) { position = heightLeft - imgHeight + margin; pdf.addPage(); pdf.addImage(imgData, 'PNG', margin, position, contentWidth, imgHeight); heightLeft -= (pdf.internal.pageSize.getHeight() - margin); } pdf.save('Mutual_NDA.pdf'); } catch (error) { console.error("PDF generation failed:", error); } finally { downloadPdfBtn.innerHTML = originalButtonText; downloadPdfBtn.disabled = false; } }; // Event Listeners tabButtons.forEach((btn, i) => btn.addEventListener('click', () => switchTab(i + 1))); prevBtn.addEventListener('click', () => switchTab(currentTab - 1)); nextBtn.addEventListener('click', () => switchTab(currentTab + 1)); downloadPdfBtn.addEventListener('click', handleDownloadPdf); // Initial setup updateNavButtons(); });
Scroll to Top