Corporate Bylaws Generator

Corporate Bylaws Generator

Fill in the details across the tabs to generate your corporate bylaws.

The corporation shall indemnify to the fullest extent permitted by the laws of the State of ${data.corpState} any person who was or is a party or is threatened to be made a party to any threatened, pending or completed action, suit or proceeding, whether civil, criminal, administrative or investigative, by reason of the fact that he or she is or was a director, officer, employee or agent of the corporation.

ARTICLE VII - AMENDMENTS TO BYLAWS

These bylaws may be altered, amended or repealed and new bylaws may be adopted by a majority of the entire Board of Directors at any regular meeting of the Board, or at any special meeting of the Board if notice of such alteration, amendment, repeal or adoption of new bylaws be contained in the notice of such special meeting.

The foregoing bylaws were adopted by the Board of Directors of the corporation on the date set forth below.

Date: ____________________

____________________, Secretary

`; document.getElementById('bylaws-output-container').innerHTML = `
${bylawsText}
`; document.getElementById('pdf-download-section').classList.remove('hidden'); showTab(tabs.length - 1); } // Function to handle PDF downloading async function downloadAsPdf() { const pdfLoader = document.getElementById('pdf-loader'); pdfLoader.classList.remove('hidden'); downloadPdfBtn.disabled = true; try { const { jsPDF } = window.jspdf; const doc = new jsPDF({ orientation: 'p', unit: 'pt', format: 'letter' }); const bylawsOutput = document.getElementById('bylaws-output').cloneNode(true); // Simple text conversion for PDF const title = bylawsOutput.querySelector('h2').innerText; const articles = bylawsOutput.querySelectorAll('h3'); const paragraphs = bylawsOutput.querySelectorAll('p'); const signature = bylawsOutput.querySelector('.signature-section').innerText; const margin = 40; const maxWidth = doc.internal.pageSize.getWidth() - margin * 2; let y = margin + 20; doc.setFont('times', 'bold'); doc.setFontSize(16); doc.text(title, doc.internal.pageSize.getWidth() / 2, y, { align: 'center' }); y += 40; const processNode = (node) => { doc.setFont('times', 'normal'); doc.setFontSize(12); let nodeStyle = 'normal'; if (node.tagName === 'H3') { nodeStyle = 'bold'; y += 10; } else if (node.querySelector('strong')) { // This simplified version handles strong tags inside paragraphs } else if (node.classList.contains('signature-section')) { y += 20; } let text = node.innerText; let splitText = doc.splitTextToSize(text, maxWidth); splitText.forEach(line => { if (y > doc.internal.pageSize.getHeight() - margin) { doc.addPage(); y = margin; } if (node.tagName === 'H3') { doc.setFont('times', 'bold'); } else { doc.setFont('times', 'normal'); } doc.text(line, margin, y); y += 14; // Line height }); if (node.tagName === 'H3') { y += 5; } }; bylawsOutput.childNodes.forEach(node => { if (node.nodeType === Node.ELEMENT_NODE) { // Process only element nodes processNode(node); } }); doc.save(`${document.getElementById('corpName').value.trim()}_Bylaws.pdf`); } catch (error) { console.error("Error generating PDF:", error); alert("There was an error generating the PDF. Please try again."); } finally { pdfLoader.classList.add('hidden'); downloadPdfBtn.disabled = false; } } // Event Listeners generateBtn.addEventListener('click', generateBylaws); downloadPdfBtn.addEventListener('click', downloadAsPdf); });
Scroll to Top