Ghostwriting Assistant

Ghostwriting Assistant

Manage clients, capture their voice, and draft content seamlessly.

Project At a Glance

0 / 1000 words

Client & Project Details

Client Voice Profile

Drafting Space

Word Count: 0

Writing Sample Snippet:

${projectData.voice.samples.substring(0, 300) + (projectData.voice.samples.length > 300 ? '...' : '') || 'No samples provided.'}

Content Draft

${projectData.draft || 'No draft content written.'}
`; const pdfTemplate = document.getElementById('pdf-template'); pdfTemplate.innerHTML = reportHtml; pdfTemplate.style.position = 'absolute'; pdfTemplate.style.left = '-9999px'; pdfTemplate.classList.remove('invisible'); try { const { jsPDF } = window.jspdf; const canvas = await html2canvas(pdfTemplate.querySelector('.pdf-report-container'), { scale: 2, useCORS: true }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'p', unit: 'pt', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = (canvas.height * pdfWidth) / canvas.width; pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight); pdf.save(`${(projectData.title || 'Project_Brief').replace(/\s+/g, '_')}.pdf`); } catch(e) { console.error('PDF Generation Error:', e); } finally { button.disabled = false; button.textContent = originalText; pdfTemplate.innerHTML = ''; pdfTemplate.classList.add('invisible'); } } downloadPdfBtn.addEventListener('click', generatePdfReport); // --- INITIALIZATION --- switchTab(0); bindInputs(); updateDashboard(); });
Scroll to Top