BAB (Before-After-Bridge) Copy Generator

BAB Copy Generator

Create compelling Before-After-Bridge marketing copy to connect with your audience.

Copy Details

Generated BAB Copy

Your generated copy will appear here...

${beforeText}

After

${afterText}

Bridge

${bridgeText}

`, textForPdf: `BEFORE\n${beforeText}\n\nAFTER\n${afterText}\n\nBRIDGE\n${bridgeText}` }; lastCopy = copy; renderCopy(copy); }; const renderCopy = (copy) => { babOutput.innerHTML = copy.html; pdfButtonContainer.classList.remove('hidden'); }; const handlePdfDownload = () => { if (!lastCopy) return; const { jsPDF } = window.jspdf; const pdf = new jsPDF({ orientation: 'p', unit: 'pt', format: 'a4' }); const margin = 60; const pageWidth = pdf.internal.pageSize.getWidth(); pdf.setFontSize(24); pdf.setFont('Helvetica', 'bold'); pdf.text("BAB Copywriting Report", pageWidth / 2, margin, { align: 'center' }); pdf.setFontSize(12); pdf.setFont('Helvetica', 'normal'); pdf.text(`Product: ${nameEl.value}`, pageWidth / 2, margin + 25, { align: 'center' }); pdf.setFontSize(11); const textLines = pdf.splitTextToSize(lastCopy.textForPdf, pageWidth - margin * 2); pdf.text(textLines, margin, margin + 70); const today = new Date().toLocaleDateString('en-US'); const pageCount = pdf.internal.getNumberOfPages(); for (let i = 1; i <= pageCount; i++) { pdf.setPage(i); const pageHeight = pdf.internal.pageSize.getHeight(); pdf.setFontSize(9); pdf.setTextColor(150); pdf.text(`Generated on ${today}`, margin, pageHeight - 30); pdf.text(`Page ${i} of ${pageCount}`, pageWidth - margin, pageHeight - 30, { align: 'right' }); } pdf.save('bab-copy.pdf'); }; generateBtn.addEventListener('click', generateCopy); downloadPdfBtn.addEventListener('click', handlePdfDownload); // Initial generation on load generateCopy(); });
Scroll to Top