Online Self-Publishing Guide Tool

Online Self-Publishing Guide

Create your personalized publishing plan by following the steps below.

The foundation of a successful book is a well-written and professionally edited manuscript. Plan your editing process carefully.

Budget: $${Number(data.editingBudget).toLocaleString() || '0'}

Production

Cover Design: ${data.coverPlan}

Formatting: ${data.formattingPlan}

ISBN: ${data.isbnPlan}

Budget: $${Number(data.productionBudget).toLocaleString() || '0'}

Distribution

Strategy: ${data.distStrategy}

Platforms: ${data.platforms}

Pricing: ${data.pricing}

Marketing

Author Platform: ${data.authorPlatform}

Launch Plan: ${data.launchPlan}

Budget: $${Number(data.marketingBudget).toLocaleString() || '0'}

`; } // --- PDF Generation Logic --- async function generatePdf() { const data = {}; for (const key in inputs) { if (inputs[key]) { data[key] = inputs[key].value || 'Not specified'; } } const totalBudget = (Number(data.editingBudget) || 0) + (Number(data.productionBudget) || 0) + (Number(data.marketingBudget) || 0); pdfContentArea.innerHTML = `

Self-Publishing Plan: ${data.title}

Estimated Total Budget: $${totalBudget.toLocaleString()}

Writing & Editing

Editing Plan & Notes

${data.editingPlan}

Estimated Budget

$${Number(data.editingBudget).toLocaleString() || '0'}

Production

Cover Design Plan

${data.coverPlan}

Formatting Plan

${data.formattingPlan}

ISBN Plan

${data.isbnPlan}

Estimated Budget

$${Number(data.productionBudget).toLocaleString() || '0'}

Distribution

Distribution Strategy

${data.distStrategy}

Platforms & Aggregators

${data.platforms}

Pricing Strategy

${data.pricing}

Marketing

Author Platform Building

${data.authorPlatform}

Book Launch Plan

${data.launchPlan}

Estimated Budget

$${Number(data.marketingBudget).toLocaleString() || '0'}

`; pdfContentArea.style.display = 'block'; pdfContentArea.style.position = 'absolute'; pdfContentArea.style.left = '-9999px'; pdfContentArea.style.width = '800px'; try { const canvas = await html2canvas(pdfContentArea, { scale: 2, useCORS: true }); const imgData = canvas.toDataURL('image/png'); const { jsPDF } = window.jspdf; const pdf = new jsPDF({ orientation: 'portrait', unit: 'px', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = pdf.internal.pageSize.getHeight(); const imgHeight = canvas.height * pdfWidth / canvas.width; let heightLeft = imgHeight; let position = 0; pdf.addImage(imgData, 'PNG', 0, position, pdfWidth, imgHeight); heightLeft -= pdfHeight; while (heightLeft > 0) { position = position - pdfHeight; pdf.addPage(); pdf.addImage(imgData, 'PNG', 0, position, pdfWidth, imgHeight); heightLeft -= pdfHeight; } const filename = `Self-Publishing-Plan-${data.title.replace(/[^a-z0-9]/gi, '-') || 'Book'}.pdf`; pdf.save(filename); } catch (error) { console.error("Failed to generate PDF:", error); alert("Sorry, there was an error creating the PDF file."); } finally { pdfContentArea.style.display = 'none'; pdfContentArea.innerHTML = ''; } } // --- Event Listeners --- tabButtons.forEach((button, index) => { button.addEventListener('click', () => setActiveTab(index)); }); prevBtn.addEventListener('click', () => { if (currentTabIndex > 0) setActiveTab(currentTabIndex - 1); }); nextBtn.addEventListener('click', () => { if (currentTabIndex < tabButtons.length - 1) setActiveTab(currentTabIndex + 1); }); downloadPdfBtn.addEventListener('click', generatePdf); // --- Initial State --- setActiveTab(0); });
Scroll to Top