Direct Response Ad Copy Generator

Direct Response Ad Copy Generator

Generate persuasive copy that drives action.

Define Your Ad Campaign

${line}

`; } } previewBodyEl.innerHTML = bodyHtml.replace(/<\/ul>
    /g, '') || '

    Your generated ad copy will appear here.

    '; }; const handleDownloadPdf = () => { if (!window.jspdf) { console.error('jsPDF not loaded.'); return; } const { jsPDF } = window.jspdf; const pdf = new jsPDF({ orientation: 'portrait', unit: 'pt', format: 'a4' }); const pageW = pdf.internal.pageSize.getWidth(); const margin = 50; const maxLineWidth = pageW - margin * 2; let cursorY = 0; // --- PDF Template: Ad Copy Brief --- // Header pdf.setFillColor(17, 24, 39); // Gray 900 pdf.rect(0, 0, pageW, 70, 'F'); pdf.setFont('helvetica', 'bold').setFontSize(20).setTextColor(255, 255, 255); pdf.text('AD COPY BRIEF & CREATIVE', margin, 45); cursorY = 110; const addSection = (title, content) => { pdf.setFont('helvetica', 'bold').setFontSize(10).setTextColor(107, 114, 128); // Gray 500 pdf.text(title.toUpperCase(), margin, cursorY); cursorY += 15; const contentLines = pdf.setFont('helvetica', 'normal').setFontSize(12).setTextColor(31, 41, 55) // Gray 800 .splitTextToSize(content, maxLineWidth); pdf.text(contentLines, margin, cursorY); cursorY += (contentLines.length * 12) + 25; pdf.setDrawColor(229, 231, 235).line(margin, cursorY - 15, pageW - margin, cursorY - 15); // Gray 200 }; addSection("Product/Service", productNameEl.value || 'N/A'); addSection("Target Audience", targetAudienceEl.value || 'N/A'); addSection("Unique Selling Proposition", uspEl.value || 'N/A'); addSection("The Offer", offerEl.value || 'N/A'); addSection("Call to Action", ctaEl.value || 'N/A'); cursorY += 10; pdf.setFont('helvetica', 'bold').setFontSize(16).setTextColor(249, 115, 22); // Orange 500 pdf.text('GENERATED COPY', margin, cursorY); cursorY += 25; const generatedLines = (generatedCopyEl.value || "No copy generated.").split('\n'); for (const line of generatedLines) { if (cursorY > pdf.internal.pageSize.getHeight() - margin) { pdf.addPage(); cursorY = margin; } if (line.startsWith('### ')) { const headingLines = pdf.setFont('helvetica', 'bold').setFontSize(12).setTextColor(31, 41, 55) .splitTextToSize(line.substring(4), maxLineWidth); pdf.text(headingLines, margin, cursorY); cursorY += (headingLines.length * 12) + 10; } else if (line.startsWith('* ')) { const bulletLines = pdf.setFont('helvetica', 'normal').setFontSize(11).setTextColor(55, 65, 81) .splitTextToSize(line.substring(2), maxLineWidth - 15); pdf.text('•', margin, cursorY); pdf.text(bulletLines, margin + 15, cursorY); cursorY += (bulletLines.length * 11) + 5; } else if (line.trim() !== "") { const paraLines = pdf.setFont('helvetica', 'normal').setFontSize(11).setTextColor(55, 65, 81) .splitTextToSize(line, maxLineWidth); pdf.text(paraLines, margin, cursorY); cursorY += (paraLines.length * 11) + 10; } } pdf.save(`Ad-Copy-${(productNameEl.value || 'Untitled').replace(/\s+/g, '-')}.pdf`); }; // --- Event Listeners --- if (generateBtn) generateBtn.addEventListener('click', handleGenerateClick); if (downloadPdfBtn) downloadPdfBtn.addEventListener('click', handleDownloadPdf); });
Scroll to Top