Meeting Notes Formatter

Meeting Notes Formatter

Your Formatted Meeting Notes

The formatted notes will appear below. You can click on the text to make edits before downloading.

Your notes will appear here.

Go to the "Input & Configuration" tab to get started.

Date: ${formattedDate}

`; } if (attendees) { fullHtml += `

Attendees: ${attendees}

`; } fullHtml += '
'; fullHtml += formatNotes(raw); elements.formattedOutput.innerHTML = fullHtml; elements.downloadPdfBtn.disabled = false; switchTab('dashboard'); }; /** * Handles the PDF download functionality. */ const downloadPDF = async () => { const { jsPDF } = window.jspdf; const content = elements.formattedOutput; if (!content || content.innerText.trim() === '') return; try { const canvas = await html2canvas(content, { scale: 2, // Higher scale for better resolution backgroundColor: '#ffffff', 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 margin = 40; const imgWidth = pdfWidth - (margin * 2); const imgHeight = (canvas.height * imgWidth) / canvas.width; let heightLeft = imgHeight; let position = margin; pdf.addImage(imgData, 'PNG', margin, position, imgWidth, imgHeight); heightLeft -= (pdfHeight - (margin * 2)); while (heightLeft > 0) { position = heightLeft - imgHeight - margin; pdf.addPage(); pdf.addImage(imgData, 'PNG', margin, position, imgWidth, imgHeight); heightLeft -= (pdfHeight - (margin * 2)); } const safeTitle = (elements.meetingTitle.value.trim() || 'meeting-notes').replace(/[^a-z0-9]/gi, '_').toLowerCase(); pdf.save(`${safeTitle}.pdf`); } catch (error) { console.error("Error generating PDF:", error); } }; // --- EVENT LISTENERS --- elements.tabButtons.dashboard.addEventListener('click', () => switchTab('dashboard')); elements.tabButtons.input.addEventListener('click', () => switchTab('input')); elements.prevBtn.addEventListener('click', () => { const currentIndex = TABS.indexOf(activeTab); if (currentIndex > 0) switchTab(TABS[currentIndex - 1]); }); elements.nextBtn.addEventListener('click', () => { const currentIndex = TABS.indexOf(activeTab); if (currentIndex < TABS.length - 1) switchTab(TABS[currentIndex + 1]); }); elements.formatNotesBtn.addEventListener('click', handleFormat); elements.downloadPdfBtn.addEventListener('click', downloadPDF); // Set default date to today elements.meetingDate.valueAsDate = new Date(); // --- INITIALIZATION --- switchTab('dashboard'); // Start on the dashboard tab });
Scroll to Top