Smart FAQ Generator for E-commerce Stores

Smart FAQ Generator

Instantly create helpful FAQs for your e-commerce store.

Enter a topic to get started.

${faq.a}

`).join(''); pdfContentEl.classList.remove('hidden'); html2canvas(pdfContentEl, { scale: 2 }).then(canvas => { pdfContentEl.classList.add('hidden'); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'portrait', unit: 'pt', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const margin = 40; const imgWidth = pdfWidth - (margin * 2); const imgHeight = (canvas.height * imgWidth) / canvas.width; pdf.addImage(imgData, 'PNG', margin, margin, imgWidth, imgHeight); pdf.save(`${topic.replace(/\s+/g, '-')}-faq.pdf`); }).catch(err => { console.error("Error generating PDF:", err); pdfContentEl.classList.add('hidden'); }); }; // --- Event Listeners --- generateBtn.addEventListener('click', handleGeneration); faqAccordion.addEventListener('click', handleAccordionClick); pdfBtn.addEventListener('click', handleDownloadPdf); });
Scroll to Top